Skip to content

Commit

Permalink
Add base TLS config if no client cert is used
Browse files Browse the repository at this point in the history
  • Loading branch information
f-blass committed Mar 25, 2024
1 parent 9945f6b commit a7d5732
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion httpclient/httpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ const UserAgent = "go-sec-lib"
// identity provides certificate and key
func DefaultTLSConfig(identity env.Identity) (*tls.Config, error) {
if !identity.IsCertificateBased() {
return nil, nil
return &tls.Config{
MinVersion: tls.VersionTLS12,
Renegotiation: tls.RenegotiateOnceAsClient,
}, nil
}
certPEMBlock := []byte(identity.GetCertificate())
keyPEMBlock := []byte(identity.GetKey())
Expand Down

0 comments on commit a7d5732

Please sign in to comment.