Skip to content
38 changes: 34 additions & 4 deletions https/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,48 @@ The config file should be written in YAML format, and is reloaded on each connec
## Sample Config

```
tls_config:
# Certificate and key files for server to use to authenticate to client
tls_server_config:
# Certificate and key files for server to use to authenticate to client.
cert_file: <filename>
key_file: <filename>

# Server policy for client authentication. Maps to ClientAuth Policies
# Server policy for client authentication. Maps to ClientAuth Policies.
# For more detail on clientAuth options: [ClientAuthType](https://golang.org/pkg/crypto/tls/#ClientAuthType)
[ client_auth_type: <string> | default = "NoClientCert" ]

# CA certificate for client certificate authentication to the server
# CA certificate for client certificate authentication to the server.
[ client_ca_file: <filename> ]

# Minimum TLS version that is acceptable.
[ min_version: <string> | default = "TLS12" ]

# Maximum TLS version that is acceptable.
[ max_version: <string> | default = "TLS13" ]

# List of supported cipher suites for TLS versions up to TLS 1.2. If empty,
# Go default cipher suites are used. Available cipher suites are documented
# in the go documentation:
# https://golang.org/pkg/crypto/tls/#pkg-constants
[ cipher_suites:
[ - <string> ] ]

# prefer_server_cipher_suites controls whether the server selects the
# client's most preferred ciphersuite, or the server's most preferred
# ciphersuite. If true then the server's preference, as expressed in
# the order of elements in cipher_suites, is used.
[ prefer_server_cipher_suites: <bool> | default = true ]

# Elliptic curves that will be used in an ECDHE handshake, in preference
# order. Available curves are documented in the go documentation:
# https://golang.org/pkg/crypto/tls/#CurveID
[ curve_preferences:
[ - <string> ] ]

http_server_config:
# Enable HTTP/2 support. Note that HTTP/2 is only supported with TLS.
# This can not be changed on the fly.
[ http2: <bool> | default = true ]

# List of usernames and hashed passwords that have full access to the web
# server via basic authentication. If empty, no basic authentication is
# required. Passwords are hashed with bcrypt.
Expand Down
2 changes: 1 addition & 1 deletion https/testdata/tls_config_auth_clientCAs_invalid.bad.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tls_config :
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_ca_file : "somefile"
2 changes: 1 addition & 1 deletion https/testdata/tls_config_auth_clientCAs_missing.bad.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tls_config :
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_auth_type : "RequireAndVerifyClientCert"
2 changes: 1 addition & 1 deletion https/testdata/tls_config_auth_user_list_invalid.bad.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tls_config :
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
basic_auth_users:
Expand Down
2 changes: 1 addition & 1 deletion https/testdata/tls_config_junk_key.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
tls_config :
tls_server_config :
cert_filse: "testdata/server.crt"
2 changes: 1 addition & 1 deletion https/testdata/tls_config_noAuth.bad.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tls_config :
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_ca_file : "testdata/tls-ca-chain.pem"
2 changes: 1 addition & 1 deletion https/testdata/tls_config_noAuth.good.blocking.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tls_config :
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_auth_type : "RequireAndVerifyClientCert"
Expand Down
2 changes: 1 addition & 1 deletion https/testdata/tls_config_noAuth.good.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tls_config :
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_auth_type : "VerifyClientCertIfGiven"
Expand Down
26 changes: 26 additions & 0 deletions https/testdata/tls_config_noAuth_allCiphers.good.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_auth_type : "VerifyClientCertIfGiven"
client_ca_file : "testdata/tls-ca-chain.pem"
cipher_suites:
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
- TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
- TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
- TLS_AES_128_GCM_SHA256
- TLS_AES_256_GCM_SHA384
- TLS_CHACHA20_POLY1305_SHA256
- TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA
- TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA
- TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA
- TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
- TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
- TLS_RSA_WITH_3DES_EDE_CBC_SHA
- TLS_RSA_WITH_AES_128_CBC_SHA
- TLS_RSA_WITH_AES_256_CBC_SHA
- TLS_RSA_WITH_AES_128_GCM_SHA256
- TLS_RSA_WITH_AES_256_GCM_SHA384

10 changes: 10 additions & 0 deletions https/testdata/tls_config_noAuth_allCurves.good.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_auth_type : "VerifyClientCertIfGiven"
client_ca_file : "testdata/tls-ca-chain.pem"
curve_preferences:
- CurveP256
- CurveP384
- CurveP521
- X25519
2 changes: 1 addition & 1 deletion https/testdata/tls_config_noAuth_certPath_empty.bad.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tls_config :
tls_server_config :
cert_file : ""
key_file : "testdata/server.key"
2 changes: 1 addition & 1 deletion https/testdata/tls_config_noAuth_certPath_invalid.bad.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tls_config :
tls_server_config :
cert_file : "somefile"
key_file : "testdata/server.key"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tls_config :
tls_server_config :
cert_file : ""
key_file : ""
client_auth_type: "x"
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tls_config :
tls_server_config :
cert_file : "somefile"
key_file : "somefile"
8 changes: 8 additions & 0 deletions https/testdata/tls_config_noAuth_inventedCiphers.bad.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_auth_type : "VerifyClientCertIfGiven"
client_ca_file : "testdata/tls-ca-chain.pem"
cipher_suites:
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA2048

7 changes: 7 additions & 0 deletions https/testdata/tls_config_noAuth_inventedCurves.bad.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_auth_type : "VerifyClientCertIfGiven"
client_ca_file : "testdata/tls-ca-chain.pem"
curve_preferences:
- CurveP257
2 changes: 1 addition & 1 deletion https/testdata/tls_config_noAuth_keyPath_empty.bad.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tls_config :
tls_server_config :
cert_file : "testdata/server.crt"
key_file : ""
2 changes: 1 addition & 1 deletion https/testdata/tls_config_noAuth_keyPath_invalid.bad.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tls_config :
tls_server_config :
cert_file : "testdata/server.cert"
key_file : "somefile"
10 changes: 10 additions & 0 deletions https/testdata/tls_config_noAuth_noHTTP2.good.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_auth_type : "VerifyClientCertIfGiven"
client_ca_file : "testdata/tls-ca-chain.pem"
cipher_suites:
- TLS_RSA_WITH_AES_128_CBC_SHA
max_version: TLS12
http_server_config:
http2: false
8 changes: 8 additions & 0 deletions https/testdata/tls_config_noAuth_noHTTP2Cipher.bad.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_auth_type : "VerifyClientCertIfGiven"
client_ca_file : "testdata/tls-ca-chain.pem"
cipher_suites:
- TLS_RSA_WITH_AES_128_CBC_SHA
max_version: TLS12
10 changes: 10 additions & 0 deletions https/testdata/tls_config_noAuth_someCiphers.good.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_auth_type : "VerifyClientCertIfGiven"
client_ca_file : "testdata/tls-ca-chain.pem"
cipher_suites:
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
min_version: TLS12
max_version: TLS12
11 changes: 11 additions & 0 deletions https/testdata/tls_config_noAuth_someCiphers_noOrder.good.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_auth_type : "VerifyClientCertIfGiven"
client_ca_file : "testdata/tls-ca-chain.pem"
cipher_suites:
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
prefer_server_cipher_suites: false
min_version: TLS12
max_version: TLS12
8 changes: 8 additions & 0 deletions https/testdata/tls_config_noAuth_someCurves.good.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_auth_type : "VerifyClientCertIfGiven"
client_ca_file : "testdata/tls-ca-chain.pem"
min_version: TLS13
curve_preferences:
- CurveP521
6 changes: 6 additions & 0 deletions https/testdata/tls_config_noAuth_wrongTLSVersion.bad.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
client_auth_type : "VerifyClientCertIfGiven"
client_ca_file : "testdata/tls-ca-chain.pem"
min_version: TLS111
2 changes: 1 addition & 1 deletion https/testdata/tls_config_users.good.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tls_config :
tls_server_config :
cert_file : "testdata/server.crt"
key_file : "testdata/server.key"
basic_auth_users:
Expand Down
Loading