Commit 13919a2f authored by Pádraig Ó Conbhuí's avatar Pádraig Ó Conbhuí
Browse files

Add Fizz v2020.06.15.00 to external/fizz

parents 75fe1eb3 e81dde1f
# This file was @generated by getdeps.py
name: linux
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Install system deps
run: sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive fizz
- name: Fetch boost
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests boost
- name: Fetch ninja
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests ninja
- name: Fetch cmake
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests cmake
- name: Fetch double-conversion
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests double-conversion
- name: Fetch fmt
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fmt
- name: Fetch gflags
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests gflags
- name: Fetch glog
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests glog
- name: Fetch googletest
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests googletest
- name: Fetch libevent
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libevent
- name: Fetch snappy
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests snappy
- name: Fetch zstd
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests zstd
- name: Fetch folly
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests folly
- name: Fetch autoconf
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests autoconf
- name: Fetch automake
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests automake
- name: Fetch libtool
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libtool
- name: Fetch libsodium
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libsodium
- name: Build boost
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests boost
- name: Build ninja
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests ninja
- name: Build cmake
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests cmake
- name: Build double-conversion
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests double-conversion
- name: Build fmt
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests fmt
- name: Build gflags
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests gflags
- name: Build glog
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests glog
- name: Build googletest
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests googletest
- name: Build libevent
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests libevent
- name: Build snappy
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests snappy
- name: Build zstd
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests zstd
- name: Build folly
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests folly
- name: Build autoconf
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests autoconf
- name: Build automake
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests automake
- name: Build libtool
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests libtool
- name: Build libsodium
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests libsodium
- name: Build fizz
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. fizz --project-install-prefix fizz:/usr/local
- name: Copy artifacts
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fixup-dyn-deps --strip --src-dir=. fizz _artifacts/linux --project-install-prefix fizz:/usr/local --final-install-prefix /usr/local
- uses: actions/upload-artifact@master
with:
name: fizz
path: _artifacts
- name: Test fizz
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages test --src-dir=. fizz --project-install-prefix fizz:/usr/local
# This file was @generated by getdeps.py
name: mac
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- name: Install system deps
run: sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive fizz
- name: Fetch boost
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests boost
- name: Fetch openssl
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests openssl
- name: Fetch ninja
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests ninja
- name: Fetch cmake
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests cmake
- name: Fetch double-conversion
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests double-conversion
- name: Fetch fmt
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fmt
- name: Fetch gflags
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests gflags
- name: Fetch glog
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests glog
- name: Fetch googletest
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests googletest
- name: Fetch libevent
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libevent
- name: Fetch snappy
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests snappy
- name: Fetch zstd
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests zstd
- name: Fetch folly
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests folly
- name: Fetch autoconf
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests autoconf
- name: Fetch automake
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests automake
- name: Fetch libtool
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libtool
- name: Fetch libsodium
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libsodium
- name: Build boost
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests boost
- name: Build openssl
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests openssl
- name: Build ninja
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests ninja
- name: Build cmake
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests cmake
- name: Build double-conversion
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests double-conversion
- name: Build fmt
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests fmt
- name: Build gflags
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests gflags
- name: Build glog
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests glog
- name: Build googletest
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests googletest
- name: Build libevent
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests libevent
- name: Build snappy
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests snappy
- name: Build zstd
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests zstd
- name: Build folly
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests folly
- name: Build autoconf
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests autoconf
- name: Build automake
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests automake
- name: Build libtool
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests libtool
- name: Build libsodium
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests libsodium
- name: Build fizz
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. fizz --project-install-prefix fizz:/usr/local
- name: Copy artifacts
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages fixup-dyn-deps --src-dir=. fizz _artifacts/mac --project-install-prefix fizz:/usr/local --final-install-prefix /usr/local
- uses: actions/upload-artifact@master
with:
name: fizz
path: _artifacts
- name: Test fizz
run: python3 build/fbcode_builder/getdeps.py --allow-system-packages test --src-dir=. fizz --project-install-prefix fizz:/usr/local
# This file was @generated by getdeps.py
name: windows
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
runs-on: windows-2016
steps:
- uses: actions/checkout@v1
- name: Export boost environment
run: "echo ::set-env name=BOOST_ROOT::%BOOST_ROOT_1_69_0%"
shell: cmd
- name: Fix Git config
run: git config --system core.longpaths true
- name: Fetch libsodium
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libsodium
- name: Fetch boost
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests boost
- name: Fetch ninja
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests ninja
- name: Fetch cmake
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests cmake
- name: Fetch double-conversion
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests double-conversion
- name: Fetch fmt
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests fmt
- name: Fetch gflags
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests gflags
- name: Fetch glog
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests glog
- name: Fetch googletest
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests googletest
- name: Fetch perl
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests perl
- name: Fetch openssl
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests openssl
- name: Fetch snappy
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests snappy
- name: Fetch zlib
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests zlib
- name: Fetch zstd
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests zstd
- name: Fetch libevent
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests libevent
- name: Fetch folly
run: python build/fbcode_builder/getdeps.py --allow-system-packages fetch --no-tests folly
- name: Build libsodium
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests libsodium
- name: Build boost
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests boost
- name: Build ninja
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests ninja
- name: Build cmake
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests cmake
- name: Build double-conversion
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests double-conversion
- name: Build fmt
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests fmt
- name: Build gflags
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests gflags
- name: Build glog
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests glog
- name: Build googletest
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests googletest
- name: Build perl
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests perl
- name: Build openssl
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests openssl
- name: Build snappy
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests snappy
- name: Build zlib
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests zlib
- name: Build zstd
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests zstd
- name: Build libevent
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests libevent
- name: Build folly
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --no-tests folly
- name: Build fizz
run: python build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. fizz
- name: Copy artifacts
run: python build/fbcode_builder/getdeps.py --allow-system-packages fixup-dyn-deps --src-dir=. fizz _artifacts/windows --final-install-prefix /usr/local
- uses: actions/upload-artifact@master
with:
name: fizz
path: _artifacts
- name: Test fizz
run: python build/fbcode_builder/getdeps.py --allow-system-packages test --src-dir=. fizz
# Facebook projects that use `fbcode_builder` for continuous integration
# share this Travis configuration to run builds via Docker.
# Docker disables IPv6 in containers by default. Enable it for unit tests that need [::1].
before_script:
- if [[ "$TRAVIS_OS_NAME" != "osx" ]];
then
sudo build/fbcode_builder/docker_enable_ipv6.sh;
fi
env:
global:
- travis_cache_dir=$HOME/travis_ccache
# Travis times out after 50 minutes. Very generously leave 10 minutes
# for setup (e.g. cache download, compression, and upload), so we never
# fail to cache the progress we made.
- docker_build_timeout=40m
cache:
# Our build caches can be 200-300MB, so increase the timeout to 7 minutes
# to make sure we never fail to cache the progress we made.
timeout: 420
directories:
- $HOME/travis_ccache # see docker_build_with_ccache.sh
# Ugh, `services:` must be in the matrix, or we get `docker: command not found`
# https://github.com/travis-ci/travis-ci/issues/5142
matrix:
include:
- env: ['os_image=ubuntu:18.04', gcc_version=7]
services: [docker]
addons:
apt:
packages: python2.7
script:
# We don't want to write the script inline because of Travis kludginess --
# it looks like it escapes " and \ in scripts when using `matrix:`.
- ./build/fbcode_builder/travis_docker_build.sh
# Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at <opensource-conduct@fb.com>. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
# Contributing to Fizz
We want to make contributing to this project as easy and transparent as
possible.
## Code of Conduct
The code of conduct is described in [`CODE_OF_CONDUCT.md`](CODE_OF_CONDUCT.md).
## Pull Requests
We actively welcome your pull requests.
1. Fork the repo and create your branch from `master`.
2. If you've added code that should be tested, add tests.
3. If you've changed APIs, update the documentation.
4. Ensure the test suite passes.
5. If you haven't already, complete the Contributor License Agreement ("CLA").
## Contributor License Agreement ("CLA")
In order to accept your pull request, we need you to submit a CLA. You only need
to do this once to work on any of Facebook's open source projects.
Complete your CLA here: <https://code.facebook.com/cla>
## Issues
We use GitHub issues to track public bugs. Please ensure your description is
clear and has sufficient instructions to be able to reproduce the issue.
Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
disclosure of security bugs. In those cases, please go through the process
outlined on that page and do not file a public issue.
## License
By contributing to Fizz, you agree that your contributions will be licensed
under the LICENSE file in the root directory of this source tree.
BSD License
Copyright (c) 2018-present, Facebook, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name Facebook nor the names of its contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<p align="center">
<img width="500" height="216" alt="Fizz" src="logo2x.png">
</p>
[![Travis Build Status](https://api.travis-ci.org/facebookincubator/fizz.svg?branch=master)](https://travis-ci.org/facebookincubator/fizz)
[![CI Status](https://github.com/facebookincubator/fizz/workflows/CI/badge.svg?branch=master)](https://github.com/facebookincubator/fizz/actions?workflow=CI)
Fizz is a TLS 1.3 implementation.
Fizz currently supports TLS 1.3 drafts 28, 26 (both wire-compatible with the
final specification), and 23. All major handshake modes are supported, including
PSK resumption, early data, client authentication, and HelloRetryRequest.
More background and details are available on the
[Facebook Code Blog](https://code.fb.com/networking-traffic/deploying-tls-1-3-at-scale-with-fizz-a-performant-open-source-tls-library/).
## Dependencies
Fizz largely depends on three libraries: [folly](https://www.github.com/facebook/folly),
[OpenSSL](https://www.openssl.org/), and [libsodium](https://github.com/jedisct1/libsodium).
## Source Layout
- `fizz/crypto`: Cryptographic primitive implementations (most are wrapping
OpenSSL or libsodium)
- `fizz/record`: TLS 1.3 record layer parsing
- `fizz/protocol`: Common protocol code shared between client and server
- `fizz/client`: Client protocol implementation
- `fizz/server`: Server protocol implementation
- `fizz/tool`: Example CLI app source
## Design
The core protocol implementations are in `ClientProtocol` and `ServerProtocol`.
`FizzClientContext` and `FizzServerContext` provide configuration options.
`FizzClient` and `FizzServer` (which both inherit from `FizzBase`) provide
applications with an interface to interact with the state machine.
`FizzClient`/`FizzServer` receives events from the application layer, invokes the
correct event handler, and invokes the application `ActionVisitor` to process the
actions.
`AsyncFizzClient` and `AsyncFizzServer` provide implementations of the folly
`AsyncTransportWrapper` interface. They own an underlying transport (for example
`AsyncSocket`) and perform the TLS handshake and encrypt/decrypt application
data.
## Features
Fizz has several important features needed from a modern TLS library.
### Performance
Fizz supports scatter/gather IO by default via folly's IOBufs, and will encrypt
data in-place whenever possible, saving memcpys. Due to this and several
other optimizations, we found in our load balancer benchmarks that Fizz has 10%
higher throughput than our prior SSL library which uses folly's
[AsyncSSLSocket](https://github.com/facebook/folly/blob/master/folly/io/async/AsyncSSLSocket.h).
Fizz also consumes less memory per connection than AsyncSSLSocket.
### Async by default
Fizz has asynchronous APIs to be able to offload functions like certificate
signing and ticket decryption. The API is based on folly's
[Futures](https://github.com/facebook/folly/tree/master/folly/futures) for painless
async programming.
### TLS features
Fizz supports APIs like exported keying material as well as zero-copy APIs
needed to use TLS in other protocols like QUIC.
### Secure design abstractions
Fizz is built on a custom state machine which uses the power of the C++ type system
to treat states and actions as types of their own. As the code changes, this allows us
to catch invalid state transitions as compilation errors instead of runtime errors and
helps us move fast.
## Sample Applications
Fizz includes an example program that showcases the basic client/server functionality
supported by Fizz. The binary is called `fizz` and it has similar usage to the
`openssl` or `bssl` commands.
For example, to start a TLS server on port 443 with a specified cert:
```
fizz server -accept 443 -cert foo.pem -key foo.key
```
Then, on the same host, you can connect with:
```
fizz client -connect localhost:443
```
Both ends will echo whatever data they receive and send any terminal input to the
peer. Hitting CTRL+D on either end will terminate the connection.
The source code for this program can be found under `fizz/tool`.
## Building
### Ubuntu 16.04 LTS
To begin, you should install the dependencies we need for build. This largely
consists of [folly](https://github.com/facebook/folly)'s dependencies, as well as
[libsodium](https://github.com/jedisct1/libsodium).
```
sudo apt-get install \
g++ \
cmake \
libboost-all-dev \
libevent-dev \
libdouble-conversion-dev \
libgoogle-glog-dev \
libgflags-dev \
libiberty-dev \
liblz4-dev \
liblzma-dev \
libsnappy-dev \
make \
zlib1g-dev \
binutils-dev \
libjemalloc-dev \
libssl-dev \
pkg-config \
libsodium-dev
```
Then, build and install folly:
```
git clone https://github.com/facebook/folly
mkdir folly/build_ && cd folly/build_
cmake ..
make -j $(nproc)
sudo make install
```