Skip to content

Commit b2bece1

Browse files
authored
Merge pull request #93 from thaJeztah/deprecate_encrypted_tls
tlsconfig: deprecate support for encrypted TLS private keys
2 parents 0b8c1f4 + e1b2673 commit b2bece1

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

tlsconfig/config.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ type Options struct {
3636
ExclusiveRootPools bool
3737
MinVersion uint16
3838
// If Passphrase is set, it will be used to decrypt a TLS private key
39-
// if the key is encrypted
39+
// if the key is encrypted.
40+
//
41+
// Deprecated: Use of encrypted TLS private keys has been deprecated, and
42+
// will be removed in a future release. Golang has deprecated support for
43+
// legacy PEM encryption (as specified in RFC 1423), as it is insecure by
44+
// design (see https://go-review.googlesource.com/c/go/+/264159).
4045
Passphrase string
4146
}
4247

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

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

0 commit comments

Comments
 (0)