summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2011-04-03 16:15:34 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2011-04-03 16:15:34 (GMT)
commit9c25486093a28c345896dcd13a84d8cd5f535763 (patch)
tree2c765a1ccd760a3b6f4e9af743832a03a79df708
parent361467e5226af652fdf08bdfe5737f51eba594e4 (diff)
downloadcpython-9c25486093a28c345896dcd13a84d8cd5f535763.zip
cpython-9c25486093a28c345896dcd13a84d8cd5f535763.tar.gz
cpython-9c25486093a28c345896dcd13a84d8cd5f535763.tar.bz2
Issue #11746: Fix SSLContext.load_cert_chain() to accept elliptic curve private keys.
-rw-r--r--Misc/NEWS3
-rw-r--r--Modules/_ssl.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index da09cc9..7d817fe 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 141b1ae..e494264 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