-
Notifications
You must be signed in to change notification settings - Fork 16
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
Use without having to use verify=False #3
Comments
You are indeed right: To give a little bit of context, computers are shipped with certificates (public keys) that are signed by certificate authorities (CA). These CAs hold huge events where they generate the private key and certificates, and make a huge effort to make sure the private keys are secure. If a private key leaks people can then intercept SSL/TLS traffic at will. Therefore, to not use from mitm import Config
import pathlib
dt = pathlib.Path.home() / "Desktop"
config = Config(rsa_key=dt / "mitm.key", rsa_cert=dt / "mitm.crt", rsa_generate=True) The above code should generate two files on your desktop, Note, however, that installing certificates like these open your computer to future dangers as anyone with the export REQUESTS_CA_BUNDLE=/path/to/your/certificate.crt
python script.py Should be enough. Hopefully that helps! |
Oh, also - you can generate your own custom certificates if you would like. Take a look at: Lines 12 to 21 in b53efea
Lines 29 to 58 in b53efea
Lines 74 to 81 in b53efea
|
Let me know if anything else. Closing this for now. |
This doesn't seem to work on windows. After installing the certificate, I'm getting Code : import requests
proxies = {"http": "http://127.0.0.1:8888", "https": "https://127.0.0.1:8888"}
requests.get("https://google.com", proxies=proxies) |
Reopening issue to continue discussion. On Windows you'll likely have to install the certificate, and set trust settings. The Google query should be "windows trust self-signed certificate" - perhaps this might work? I'm not on Windows myself, so I can't test it out. |
That's how I initially did it. It doesn't work for some reason. |
It should work in theory. I don't know if there is anything else I can do to help 😕 |
And this works on Mac / Linux? |
In theory it should work in all systems. |
Hey. I'm also trying this. Going through the code, it seems like mitm creates only one certificate. What should be happening is, mitm should create a separate certificate for every domain using the CA certificate it generates right now. Right now even by using the generated certificate for verification, the request will fail:
Note how it expects the certificate sent by the proxy subject to be google.com but it isn't. The proxy is just sending the CA certificate instead of a google.com one. I might be wrong about something here. Let me know what you think. |
You are indeed right. I made a note of it here and will be pushing a patch up soon. 😄 |
Hello, I wanted to know if it was possible to use this project without having to use verify=False.
I heard this was possible by installing a certificate.
Not using verify=False while doing requests will make my program crash because of SSL errors
The text was updated successfully, but these errors were encountered: