Merge pull request #29 from Snawoot/fix_alpn

Fix ALPN for autocert
This commit is contained in:
Snawoot 2023-04-03 23:28:24 +03:00 committed by GitHub
commit 558205357d
Failed to generate hash of commit
1 changed files with 5 additions and 1 deletions

View File

@ -173,6 +173,8 @@ func makeServerTLSConfig(certfile, keyfile, cafile, ciphers string, h2 bool) (*t
cfg.CipherSuites = makeCipherList(ciphers) cfg.CipherSuites = makeCipherList(ciphers)
if h2 { if h2 {
cfg.NextProtos = []string{"h2", "http/1.1"} cfg.NextProtos = []string{"h2", "http/1.1"}
} else {
cfg.NextProtos = []string{"http/1.1"}
} }
return &cfg, nil return &cfg, nil
} }
@ -192,7 +194,9 @@ func updateServerTLSConfig(cfg *tls.Config, cafile, ciphers string, h2 bool) (*t
} }
cfg.CipherSuites = makeCipherList(ciphers) cfg.CipherSuites = makeCipherList(ciphers)
if h2 { if h2 {
cfg.NextProtos = []string{"h2", "http/1.1"} cfg.NextProtos = []string{"h2", "http/1.1", "acme-tls/1"}
} else {
cfg.NextProtos = []string{"http/1.1", "acme-tls/1"}
} }
return cfg, nil return cfg, nil
} }