Python - SSL Issue with Oauth2

前端 未结 6 1024
醉话见心
醉话见心 2020-12-14 03:41

I seem to be having an issue with SSL whenever trying to use oAuth2 in Python. I\'ve spent most of the afternoon attempting to debug it but can\'t seem to figure it out.

6条回答
  •  不知归路
    2020-12-14 04:30

    I was running into the same issue with Flask-Social's OAuth call to Facebook. The easiest solution is to install httplib2.ca_certs_locator plug-in.

    In httplib2.init.py, there is a check built-in for loading certificates from another source instead of the cacerts.txt file provided with the library:

    try:
        # Users can optionally provide a module that tells us where the CA_CERTS
        # are located.
        import ca_certs_locater
        CA_CERTS = ca_certs_locater.get()
    except ImportError:
        # Default CA certificates file bundled with httplib2.
        CA_CERTS = os.path.join(
            os.path.dirname(os.path.abspath(__file__ )), "cacerts.txt")
    

    Installing this plug-in fixed the problem for me with no code-changes/hack-a-rounds.

提交回复
热议问题