From: Antoine Pitrou Date: Sun, 3 Apr 2011 16:15:34 +0000 (+0200) Subject: Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve private keys. X-Git-Tag: v3.2.1b1~181 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9c25486093a28c345896dcd13a84d8cd5f535763;p=thirdparty%2FPython%2Fcpython.git Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve private keys. --- diff --git a/Misc/NEWS b/Misc/NEWS index da09cc99b59f..7d817fee8adf 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -49,6 +49,9 @@ Core and Builtins Library ------- +- Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve + private keys. + - sys.getfilesystemencoding() raises a RuntimeError if initfsencoding() was not called yet: detect bootstrap (startup) issues earlier. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 141b1ae88cef..e49426464e5c 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -1623,7 +1623,7 @@ load_cert_chain(PySSLContext *self, PyObject *args, PyObject *kwds) goto error; } PySSL_BEGIN_ALLOW_THREADS - r = SSL_CTX_use_RSAPrivateKey_file(self->ctx, + r = SSL_CTX_use_PrivateKey_file(self->ctx, PyBytes_AS_STRING(keyfile ? keyfile_bytes : certfile_bytes), SSL_FILETYPE_PEM); PySSL_END_ALLOW_THREADS