What does "SSLError: [SSL] PEM lib (_ssl.c:2532)" mean using the Python ssl library?
Full error message
I am trying to use connect to another party using Python 3 asyncio module and get this error:
36 sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
---> 37 sslcontext.load_cert_chain(cert, keyfile=ca_cert)
38
SSLError: [SSL] PEM lib (_ssl.c:2532)
The question is just what the error mean. My certificate is correct, the keyfile (CA certificate) might not.Solutionsource: stackoverflow \u2197
Assuming that version 3.6 is being used: See: https://github.com/python/cpython/blob/3.6/Modules/_ssl.c#L3523-L3534 PySSL_BEGIN_ALLOW_THREADS_S(pw_info.thread_state); r = SSL_CTX_check_private_key(self->ctx); PySSL_END_ALLOW_THREADS_S(pw_info.thread_state); if (r != 1) { _setSSLError(NULL, 0, __FILE__, __LINE__); goto error; } What it is saying is that SSL_CTX_check_private_key failed; thus, the private key is not correct. Reference to the likely version: https://github.com/python/cpython/blob/3.4/Modules/_ssl.c#L2529-L2535
API access
Get this solution programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/error/3e56deb69a2a3473236776b79460a732489e3db877fba62d0e948b2bb4d15cbfhash \u00b7 3e56deb69a2a3473236776b79460a732489e3db877fba62d0e948b2bb4d15cbf