SSL issue with XMLRPC using Python and Wordpress

2019-08-23 04:04发布

问题:

I am attempting to use XMLRPC to post from Python to Wordpress. The website has SSL and I am getting the following error:

SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:720)

I have spent almost a full day trying to resolve this, but cannot figure it out. Can anyone help? Thanks.

回答1:

This solved my problem.

import sys
if sys.version_info >= (2, 7, 9):
    import ssl
    ssl._create_default_https_context = ssl._create_unverified_context