2021-02-14 18:47:15 +00:00
|
|
|
package options
|
|
|
|
|
|
|
|
// Server represents the configuration for an HTTP(S) server
|
|
|
|
type Server struct {
|
2021-06-02 20:41:30 +02:00
|
|
|
// BindAddress is the address on which to serve traffic.
|
2021-02-14 18:47:15 +00:00
|
|
|
// Leave blank or set to "-" to disable.
|
|
|
|
BindAddress string
|
|
|
|
|
2021-06-02 20:41:30 +02:00
|
|
|
// SecureBindAddress is the address on which to serve secure traffic.
|
2021-02-14 18:47:15 +00:00
|
|
|
// Leave blank or set to "-" to disable.
|
|
|
|
SecureBindAddress string
|
|
|
|
|
|
|
|
// TLS contains the information for loading the certificate and key for the
|
2021-12-17 00:01:32 +01:00
|
|
|
// secure traffic and further configuration for the TLS server.
|
2021-02-14 18:47:15 +00:00
|
|
|
TLS *TLS
|
|
|
|
}
|
|
|
|
|
2021-12-17 00:01:32 +01:00
|
|
|
// TLS contains the information for loading a TLS certificate and key
|
|
|
|
// as well as an optional minimal TLS version that is acceptable.
|
2021-02-14 18:47:15 +00:00
|
|
|
type TLS struct {
|
2021-06-02 20:41:30 +02:00
|
|
|
// Key is the TLS key data to use.
|
2021-02-14 18:47:15 +00:00
|
|
|
// Typically this will come from a file.
|
|
|
|
Key *SecretSource
|
|
|
|
|
|
|
|
// Cert is the TLS certificate data to use.
|
|
|
|
// Typically this will come from a file.
|
|
|
|
Cert *SecretSource
|
2021-12-17 00:01:32 +01:00
|
|
|
|
|
|
|
// MinVersion is the minimal TLS version that is acceptable.
|
|
|
|
// E.g. Set to "TLS1.3" to select TLS version 1.3
|
|
|
|
MinVersion string
|
2022-07-13 07:40:31 -07:00
|
|
|
|
|
|
|
// CipherSuites is a list of TLS cipher suites that are allowed.
|
|
|
|
// E.g.:
|
|
|
|
// - TLS_RSA_WITH_RC4_128_SHA
|
|
|
|
// - TLS_RSA_WITH_AES_256_GCM_SHA384
|
|
|
|
// If not specified, the default Go safe cipher list is used.
|
|
|
|
// List of valid cipher suites can be found in the [crypto/tls documentation](https://pkg.go.dev/crypto/tls#pkg-constants).
|
|
|
|
CipherSuites []string
|
2021-02-14 18:47:15 +00:00
|
|
|
}
|