Python Requests throwing SSLError

前端 未结 24 2991
小蘑菇
小蘑菇 2020-11-22 02:49

I\'m working on a simple script that involves CAS, jspring security check, redirection, etc. I would like to use Kenneth Reitz\'s python requests because it\'s a great piec

24条回答
  •  日久生厌
    2020-11-22 03:34

    The name of CA file to use you could pass via verify:

    cafile = 'cacert.pem' # http://curl.haxx.se/ca/cacert.pem
    r = requests.get(url, verify=cafile)
    

    If you use verify=True then requests uses its own CA set that might not have CA that signed your server certificate.

提交回复
热议问题