Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions third-party/github.com/letsencrypt/boulder/va/tlsalpn.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,20 @@ func (va *ValidationAuthorityImpl) getChallengeCert(
MinVersion: tls.VersionTLS12,
NextProtos: []string{ACMETLS1Protocol},
ServerName: serverName,
// We expect a self-signed challenge certificate, do not verify it here.
InsecureSkipVerify: true,
// Use a custom verification function for self-signed challenge certificates.
VerifyPeerCertificate: func(certificates [][]byte, verifiedChains [][]*x509.Certificate) error {
if len(certificates) == 0 {
return errors.New("no certificates provided")
}
// Parse the presented certificate.
cert, err := x509.ParseCertificate(certificates[0])
if err != nil {
return fmt.Errorf("failed to parse certificate: %w", err)
}
// Add custom validation logic for self-signed certificates here.
// For example, validate the certificate fingerprint or other attributes.
return nil
},
}}

// This is a backstop check to avoid connecting to reserved IP addresses.
Expand Down
Loading