Skip to content

Commit

Permalink
Merge pull request #93 from thaJeztah/deprecate_encrypted_tls
Browse files Browse the repository at this point in the history
tlsconfig: deprecate support for encrypted TLS private keys
  • Loading branch information
thaJeztah authored Nov 10, 2023
2 parents 0b8c1f4 + e1b2673 commit b2bece1
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tlsconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ type Options struct {
ExclusiveRootPools bool
MinVersion uint16
// If Passphrase is set, it will be used to decrypt a TLS private key
// if the key is encrypted
// if the key is encrypted.
//
// Deprecated: Use of encrypted TLS private keys has been deprecated, and
// will be removed in a future release. Golang has deprecated support for
// legacy PEM encryption (as specified in RFC 1423), as it is insecure by
// design (see https://go-review.googlesource.com/c/go/+/264159).
Passphrase string
}

Expand Down Expand Up @@ -132,7 +137,12 @@ func adjustMinVersion(options Options, config *tls.Config) error {
}

// IsErrEncryptedKey returns true if the 'err' is an error of incorrect
// password when trying to decrypt a TLS private key
// password when trying to decrypt a TLS private key.
//
// Deprecated: Use of encrypted TLS private keys has been deprecated, and
// will be removed in a future release. Golang has deprecated support for
// legacy PEM encryption (as specified in RFC 1423), as it is insecure by
// design (see https://go-review.googlesource.com/c/go/+/264159).
func IsErrEncryptedKey(err error) bool {
return errors.Cause(err) == x509.IncorrectPasswordError
}
Expand Down

0 comments on commit b2bece1

Please sign in to comment.