Allow registry clients to connect via http2
Http2 will be enabled by default and can be disabled with a configuration option. Signed-off-by: Adam Duke <adam.v.duke@gmail.com>
This commit is contained in:
@@ -116,7 +116,7 @@ func (registry *Registry) ListenAndServe() error {
|
||||
if config.HTTP.TLS.Certificate != "" || config.HTTP.TLS.LetsEncrypt.CacheFile != "" {
|
||||
tlsConf := &tls.Config{
|
||||
ClientAuth: tls.NoClientCert,
|
||||
NextProtos: []string{"http/1.1"},
|
||||
NextProtos: nextProtos(config),
|
||||
MinVersion: tls.VersionTLS10,
|
||||
PreferServerCipherSuites: true,
|
||||
CipherSuites: []uint16{
|
||||
@@ -343,3 +343,12 @@ func resolveConfiguration(args []string) (*configuration.Configuration, error) {
|
||||
|
||||
return config, nil
|
||||
}
|
||||
|
||||
func nextProtos(config *configuration.Configuration) []string {
|
||||
switch config.HTTP.HTTP2.Disabled {
|
||||
case true:
|
||||
return []string{"http/1.1"}
|
||||
default:
|
||||
return []string{"h2", "http/1.1"}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user