mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
allow to configure ALPN protocols
Fixes #1406 Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -499,11 +499,13 @@ type Binding struct {
|
||||
// Note that TLS 1.3 ciphersuites are not configurable.
|
||||
// The supported ciphersuites names are defined here:
|
||||
//
|
||||
// https://github.com/golang/go/blob/master/src/crypto/tls/cipher_suites.go#L52
|
||||
// https://github.com/golang/go/blob/master/src/crypto/tls/cipher_suites.go#L53
|
||||
//
|
||||
// any invalid name will be silently ignored.
|
||||
// The order matters, the ciphers listed first will be the preferred ones.
|
||||
TLSCipherSuites []string `json:"tls_cipher_suites" mapstructure:"tls_cipher_suites"`
|
||||
// HTTP protocols in preference order. Supported values: http/1.1, h2
|
||||
Protocols []string `json:"protocols" mapstructure:"protocols"`
|
||||
// List of IP addresses and IP ranges allowed to set client IP proxy headers and
|
||||
// X-Forwarded-Proto header.
|
||||
ProxyAllowed []string `json:"proxy_allowed" mapstructure:"proxy_allowed"`
|
||||
|
||||
@@ -110,7 +110,7 @@ func (s *httpdServer) listenAndServe() error {
|
||||
config := &tls.Config{
|
||||
GetCertificate: certMgr.GetCertificateFunc(certID),
|
||||
MinVersion: util.GetTLSVersion(s.binding.MinTLSVersion),
|
||||
NextProtos: []string{"http/1.1", "h2"},
|
||||
NextProtos: util.GetALPNProtocols(s.binding.Protocols),
|
||||
CipherSuites: util.GetTLSCiphersFromNames(s.binding.TLSCipherSuites),
|
||||
}
|
||||
httpServer.TLSConfig = config
|
||||
|
||||
Reference in New Issue
Block a user