What does “SSLError: [SSL] PEM lib (_ssl.c:2532)” mean using the Python ssl library?

前端 未结 5 1871
死守一世寂寞
死守一世寂寞 2020-12-06 04:23

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)
---         


        
5条回答
  •  暖寄归人
    2020-12-06 04:32

    In my case, this error meant that my certificate had the wrong file extension. I had to convert my cert.dir file to a cert.pem file using the below:

    openssl x509 -inform der -in cert.der -out cert.pem 
    

提交回复
热议问题