mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-04 20:03:18 +02:00
config: disable Strict-Transport-Security when using a self-signed certificate (#3743)
This commit is contained in:
parent
01445a8c00
commit
2c9087f5e7
6 changed files with 77 additions and 33 deletions
|
@ -63,6 +63,16 @@ func GetCertificateForDomain(certificates []tls.Certificate, domain string) (*tl
|
|||
return GenerateSelfSignedCertificate(domain)
|
||||
}
|
||||
|
||||
// HasCertificateForDomain returns true if a TLS certificate matches the given domain.
|
||||
func HasCertificateForDomain(certificates []tls.Certificate, domain string) bool {
|
||||
for i := range certificates {
|
||||
if matchesDomain(&certificates[i], domain) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// GetCertificateDomains gets all the certificate's matching domain names.
|
||||
// Will return an empty slice if certificate is nil, empty, or x509 parsing fails.
|
||||
func GetCertificateDomains(cert *tls.Certificate) []string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue