-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
HTTPS request throught Proxy not working (but working fine with java.net) #8233
Comments
I'm trying to reproduce on #8235 While I have a failure, I'm not sure it's the same, but I'll keep digging. |
Looking a bit more at your case, it's failing as unauthenticated. But I don't think URLConnection supports authentication with http proxies either. So it's strange. If you have a username and password, you can set the proxyAuthenticator on the OkHttpClient. It's used here, which is why you are seeing that failure message.
|
Closing as auth is disabled also in JDK since 2016 https://www.oracle.com/java/technologies/javase/8u111-relnotes.html Please reopen with more info, or a reproduction we can test against. |
I don't have credentials so... any recommandation ? |
https://github.com/yschimke/okhttp/blob/9ee5c7cc9d830fe72b980b6811f8c7e75a91a7e7/container-tests/src/test/java/okhttp3/containers/BasicProxyTest.kt demonstrates proxy examples for OkHttp vs URLConnection. Including that OkHttp fails on https with HTTP/2. So you could try forcing HTTP1.1?
Which I guess confirms what you are seeing. But I don't understand the "Failed to authenticate with proxy" |
I have a kerberos authentication instead ! Just reminded me that |
I tried forcing HTTP1.1 i got the same Exception. |
Ahhh, yep. I forgot. Try this #5978
|
I tried already but same :'( |
I'll add an example to that test I linked to. |
Hi,
I need to request an API (HTTPS) throught a Proxy.
This code below with java.net is working fine.
I'm trying to renew this code with OkHttp API. I can request any HTTP url but not HTTPS, everytime i get the same Exception "Failed to authenticate with proxy".
Here's my code:
As you can see, I tried to set socketFactory in different way.
I already check some other issues with the same problem but no solution...
Any idea why it's not working with okhttp but working with java.net ?
The text was updated successfully, but these errors were encountered: