-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ssl load_verify_locations cadata can't work #3148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It works well in Linux, and the above problems only reappear in window. import ssl
import urllib.request
from certifi import where, contents
req = urllib.request.Request(url="https://www.httpbin.org")
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
ssl_context.verify_mode = ssl.CERT_REQUIRED
ssl_context.load_verify_locations(cafile=where(), capath=None, cadata=None)
html = urllib.request.urlopen(req, context=ssl_context).read().decode()
print(html)
|
This code also works in Rustpython with linux Welcome to the magnificent Rust Python 0.1.2 interpreter 😱 🖖
>>>>> import urllib.request
>>>>> req = urllib.request.Request(url="https://www.httpbin.org")
>>>>> html = urllib.request.urlopen(req).read().decode()
>>>>> print(html)
<!DOCTYPE html>
<html lang="en">
... |
Oh, yea, I've known about this for a while and I've tried a couple times to figure out why it doesn't work. No luck so far; I last tried a couple months ago iirc. |
Could https://bugs.python.org/issue36011 be related? |
Oh, lol, I actually fixed this back in June but I just forgot and never opened a PR; to be fair I left for summer camp a couple days after I got it working but still 😅 Could you check if #3210 works? |
I recompiled the test and passed. |
build
RustPython
output
Python
SSL
The text was updated successfully, but these errors were encountered: