Questions tagged [httpsurlconnection]
329 questions
5
votes
1 answer
Why is HttpsURLConnection.getServerCertificates() returning different results in Java6 vs Java7?
I have code like this:
// configure the SSLContext with a TrustManager
SSLContext ctx = SSLContext.getInstance("TLS");
ctx.init(new KeyManager[0],
new TrustManager[] {new DefaultTrustManager()},
new…

Cheeso
- 189,189
- 101
- 473
- 713
5
votes
1 answer
Does HttpsURLConnection.getInputStream() makes automatic retries?
I am making a service request to a server using HttpsURLConnection like the code below :
URL url = new URL("service/url");
HttpsURLConnection connection = (HttpsURLConnection)…

gnuger
- 305
- 2
- 12
4
votes
4 answers
HttpsURLConnection getHeaderFields not returning set-cookie
I'm sending a get request to one HTTPS URL and somehow I'm getting null value for "Set-Cookie". When iterating I can see header-key is having "set-cookie" but header-value is coming as null.
Here is my code:
URL obj = new…

bbajaj
- 83
- 2
- 8
4
votes
0 answers
HttpsURLConnection Already connected while trying to add cookies
I am receiving the exception with this stack trace
Exception in thread "main" java.lang.IllegalStateException: Already connected
at sun.net.www.protocol.http.HttpURLConnection.setRequestProperty(HttpURLConnection.java:2410)
at…

Sherif Ashraf
- 41
- 2
4
votes
2 answers
"Connection already established" exception in HttpsURLConnection
I am trying to do a POST request using HttpsURLConnection, and get
java.net.ProtocolException: Connection already established
on setRequestMethod Weirdly, conn.connected returns false just before.
What am I missing?
URL url = new…

jul
- 36,404
- 64
- 191
- 318
4
votes
1 answer
SSLSocket of HttpsURLConnection
I have a JEditorPane which loads a website over SSL/TLS. My goal is to get (with reflection) specific information of the SSL connection like the finished message of the SSL handshake. The only thing I get from JEditorPane is the URL and thus the…

Christian K
- 41
- 1
- 2
3
votes
3 answers
Java setProperty "https.protocols", "TLSv1.2" for one REST Call
currently I have to use Java 7 (can't change it atm) and the default TLS Version is 1.0(?), so below 1.2. And now i have to use an REST Api which doesnt accept any TLS below TLSv1.2.
So my Solution for this was:
Before the REST…

Kamui
- 106
- 1
- 1
- 13
3
votes
0 answers
Google Recaptcha from java failing with connection timeout
I am trying to add google recaptcha in my application. below is the code for validating google captcha.
try {
URL obj = new URL("https://www.google.com/recaptcha/api/siteverify");
HttpsURLConnection con =…

SUNNY
- 125
- 1
- 3
- 13
3
votes
0 answers
Android hooking HTTPS traffic using Frida
I'm trying to learn Frida to hook into various application. Specifically I'm trying to hook into Android applications, I'm using the Appmon project. That project has an HTTPS.js script that hooks into the getInputStream and getOutputStream from the…

Frank
- 151
- 1
- 2
- 7
3
votes
0 answers
HTTPS connections in android with firebase performance monitoring
I have just integrated firebase performance monitoring in my android app.
In our infrastructure, sometimes we need to connect to a local dev machine over https, and I use this piece of code to avoid ssl certificate checking when connecting to a…

Apperside
- 3,542
- 2
- 38
- 65
3
votes
2 answers
Android 7.0 : 'javax.net.ssl.SSLHandshakeException: Connection closed by peer
When I am trying to access a 'https' web service from my app , it is giving a 'javax.net.ssl.SSLHandshakeException: Connection closed by peer' error. The same Web Service works fine in the Chrome browser through.
This issue is happening only on…

Code_Yoga
- 2,968
- 6
- 30
- 49
3
votes
0 answers
Android - App in Power Saving Mode fails to connect to the internet while not in foreground
I have an app which I wake up using GCM notification and make it connect to the server via an https connection.
I noticed on recent android OS that when my app enters power saving mode ("apps that have not been used for more than 3 days have been…

lyc001
- 777
- 1
- 10
- 25
3
votes
1 answer
media uploading to cloud using signed url interup due to some ssl certificate problems?
I am trying to upload a video file to cloud storage using a signed URL. HTTP put method is used for uploading. When I am try to connect using "HttpsUrl` connection", it returns some error like javax.net.ssl.SSLHandshakeException: Handshake failed.…

Nison Cheruvathur
- 381
- 3
- 15
3
votes
2 answers
SSLHandShakeException in S3 and devices having Android 4.x version
I'm using SSL certificate with HTTPS connection.I can login with the Samsung S4, not on Huawei and Samsung S3. I think it has to do with Android 4.x, on which you cannot login.Login works on Android 5.x it seems. Can anyone please guide that which…

Usman Rana
- 2,067
- 1
- 21
- 32
3
votes
3 answers
Authenticator response code 400
I tried hitting my server using HttpsURLConnection, got response code 401 - need to authenticate. Tried the following:
Authenticator.setDefault (new Authenticator() {
protected PasswordAuthentication…

Adam
- 1,486
- 3
- 20
- 35