Python Requests throwing SSLError

前端 未结 24 2656
小蘑菇
小蘑菇 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:37

    I was having a similar or the same certification validation problem. I read that OpenSSL versions less than 1.0.2, which requests depends upon sometimes have trouble validating strong certificates (see here). CentOS 7 seems to use 1.0.1e which seems to have the problem.

    I wasn't sure how to get around this problem on CentOS, so I decided to allow weaker 1024bit CA certificates.

    import certifi # This should be already installed as a dependency of 'requests'
    requests.get("https://example.com", verify=certifi.old_where())
    

提交回复
热议问题