1
0
Fork 0

chore: update linter

This commit is contained in:
Ludovic Fernandez 2024-02-19 15:44:03 +01:00 committed by GitHub
parent 1034646ae2
commit 88a2020817
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 139 additions and 218 deletions

View file

@ -6,6 +6,7 @@ import (
"crypto/x509"
"errors"
"fmt"
"slices"
"strings"
"sync"
@ -181,7 +182,7 @@ func (m *Manager) Get(storeName, configName string) (*tls.Config, error) {
tlsConfig.GetCertificate = func(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error) {
domainToCheck := types.CanonicalDomain(clientHello.ServerName)
if isACMETLS(clientHello) {
if slices.Contains(clientHello.SupportedProtos, tlsalpn01.ACMETLS1Protocol) {
certificate := acmeTLSStore.GetBestCertificate(clientHello)
if certificate == nil {
log.WithoutContext().Debugf("TLS: no certificate for TLSALPN challenge: %s", domainToCheck)
@ -419,13 +420,3 @@ func buildDefaultCertificate(defaultCertificate *Certificate) (*tls.Certificate,
}
return &cert, nil
}
func isACMETLS(clientHello *tls.ClientHelloInfo) bool {
for _, proto := range clientHello.SupportedProtos {
if proto == tlsalpn01.ACMETLS1Protocol {
return true
}
}
return false
}