service: fix alpn certificate usage

Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
2024-12-21 14:44:56 +01:00
parent 174aa3a497
commit 939c060513
2 changed files with 4 additions and 3 deletions

View File

@ -566,6 +566,7 @@ func (o *options) parseTLSConfig() error {
if o.tlsConfig != nil {
return nil
}
nextProtos := []string{"h2", "h2c", "http/1.1", "acme-tls/1"}
if !o.hasTLSConfig() {
if !o.secure {
return nil
@ -593,6 +594,7 @@ func (o *options) parseTLSConfig() error {
o.tlsConfig = &tls.Config{
Certificates: []tls.Certificate{cert},
ClientAuth: tls.NoClientCert,
NextProtos: nextProtos,
}
return nil
}
@ -612,6 +614,7 @@ func (o *options) parseTLSConfig() error {
o.tlsConfig = &tls.Config{
Certificates: []tls.Certificate{cert},
RootCAs: caCertPool,
NextProtos: nextProtos,
}
if !o.hasClientTLSConfig() {
return nil