Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c25486

Browse files
committed
Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve private keys.
1 parent 361467e commit 9c25486

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ Core and Builtins
4949
Library
5050
-------
5151

52+
- Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve
53+
private keys.
54+
5255
- sys.getfilesystemencoding() raises a RuntimeError if initfsencoding() was not
5356
called yet: detect bootstrap (startup) issues earlier.
5457

Modules/_ssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ load_cert_chain(PySSLContext *self, PyObject *args, PyObject *kwds)
16231623
goto error;
16241624
}
16251625
PySSL_BEGIN_ALLOW_THREADS
1626-
r = SSL_CTX_use_RSAPrivateKey_file(self->ctx,
1626+
r = SSL_CTX_use_PrivateKey_file(self->ctx,
16271627
PyBytes_AS_STRING(keyfile ? keyfile_bytes : certfile_bytes),
16281628
SSL_FILETYPE_PEM);
16291629
PySSL_END_ALLOW_THREADS

0 commit comments

Comments
 (0)