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:
@@ -82,7 +82,7 @@ func (s *webDavServer) listenAndServe(compressor *middleware.Compressor) error {
|
||||
httpServer.TLSConfig = &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),
|
||||
}
|
||||
logger.Debug(logSender, "", "configured TLS cipher suites for binding %q: %v, certID: %v",
|
||||
|
||||
@@ -128,11 +128,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 to enable in preference order. Supported values: http/1.1, h2
|
||||
Protocols []string `json:"protocols" mapstructure:"protocols"`
|
||||
// Prefix for WebDAV resources, if empty WebDAV resources will be available at the
|
||||
// root ("/") URI. If defined it must be an absolute URI.
|
||||
Prefix string `json:"prefix" mapstructure:"prefix"`
|
||||
|
||||
Reference in New Issue
Block a user