Python SSL requests and Let's Encrypt certs

前端 未结 3 2060
生来不讨喜
生来不讨喜 2021-01-04 20:59

I\'m struggling at the moment to get the requests library to perform a simple GET request to a site of mine with a Let\'s Encrypt certificate. All\'s well with

3条回答
  •  孤街浪徒
    2021-01-04 21:43

    On OSX you can export all the certs in your keychain access to a .pem file and then point requests to that file: http://movingpackets.net/2015/03/18/telling-openssl-about-your-root-certificates/

    CA_BUNDLE = path_to_your_exported_file.pem
    response = requests.get(user_account_url, verify=CA_BUNDLE)
    

提交回复
热议问题