-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Certificate Issue in Windows and with Proxy #185
Comments
The certificate is to be able to speak with the proxy, or with the destination website? |
I believe it is the certificate for the proxy, the destination website is just reddit in this case |
Hm, and if you don't set the cert, what happens? You cannot connect to the proxy? Can you make requests without the proxy and cert? |
HTTPS TestsWith proxy & without cert
Without proxy & with cert Runs for a long time, finally giving Without proxy or cert Runs for a long time, finally giving |
Ah, so it looks like without the proxy, you're hitting a firewall or something that prevents the connection establishing with reddit. With the proxy and no certificate, are you able to connect to HTTP sites (not HTTPS)? I assume that without the certificate, the connection the proxy cannot be trusted, and so no other requests can work. I'd love to dig further into this, it seems related to the use of schannel on Windows. But to unblock you, there is something you can do if you don't care to dig as well. Since reqwest uses schannel on Windows, that means it will make use of the certificate store of the operating system. See here for how to add a certificate to the OS trust store. |
Oh also, knowing what Windows version you're using would be very useful. |
Thanks for the advice! I can try your suggestions on Monday when back in the office. I'm using Windows 7. by the way. |
HTTP TestsWith proxy & with certificate: 🆗 With proxy & without certificate: 🆗 Without proxy & with cert: Runs for a long time, finally giving Without proxy or cert Runs for a long time, finally giving |
I use Rust in an corporate environment in Windows.
I sucessfully got cargo to work with the following settings in the
.cargo/config
fileWhere
cert.pem
was obtained from my system.Now, using reqwest I can successfully access HTTP urls using the proxy, however when accessing HTTPS urls I get the following error:
Error { kind: Io(Error { repr: Custom(Custom { kind: Other, error: Error { repr: Os { code: -2146762487, message: "A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider." } } }) }), url: Some("https://<website>.com") }
My code looks like so:
Where
cert.der
is the DER encodedcert.pem
seen in the above cargo config.Am I using the library wrong, or is there a bug in reqwest or its dependencies? Happy to provide more information as required.
The text was updated successfully, but these errors were encountered: