Questions tagged [httpsurlconnection]
329 questions
0
votes
0 answers
Configure wildcard SSL hostnameverifier in java
My question is basically to resolve a SSLException due to use of wildcard certificates in my web service calls. Now before people redirect me to any existing SO questions, please note that I am aware of using/creating a Custom hostnameverifier and…

gsonal
- 11
- 1
- 6
0
votes
1 answer
How to enable or implement logging for HttpsURLConnection traffic on Android?
I need to be able to log (at least) headers and (optionally) body of unencrypted messages sent / received using HttpsURLConnection in my application. This should be similar to this.
Is there a simple way to do it (e.g. set some flags to enable it)?

ivan_onys
- 2,282
- 17
- 21
0
votes
1 answer
Java ssl/https connection to JAX-WS (deployed in WL 10.3) fails
I am attempting to write a Java https client (Using HttpsURLConnection) using jdk version 1.6.0_29.
I then Imported the certificate /wlserver_10.3/server/lib/CertGenCA.der to the keystore of the client. by following command:
keytool -import -alias…

user2040528
- 11
- 1
- 6
0
votes
1 answer
Trying to setPage() from a HttpsURLConnection
I'm trying to get the page from a HttpsURLConnection to setPage() on a component.
java.lang.ClassCastException: sun.net.www.protocol.http.HttpURLConnection cannot be cast to javax.net.ssl.HttpsURLConnection
That's an error I get.
Any fixes?
URL…

KeirDavis
- 665
- 2
- 10
- 32
0
votes
1 answer
How can I load keystore using resource from another jar.
my problem i following: I have two jars build by maven. One jar contains a logic which wraps some classes from jave.net.ssl to make https requests when scheme in URL is https: After obtaining HttpsUrlConnection I'm obtaining SSLSocketFactory as…

voytech
- 380
- 3
- 13
0
votes
1 answer
Sending json object using HttpsUrlConnection in android
I am sending a json object to the server using HttpsUrlConnection as following
try{
JSONObject jobj=new JSONObject();
jobj.put("UserName","demo1");
jobj.put("Password","demo1");
Log.e("json string :",jobj.toString());
byte[]…

surendra
- 2,217
- 7
- 34
- 42
0
votes
0 answers
HttpsURLConnection getContent nullpointerexception with ICS
I'm getting a java.lang.NullPointerException when trying to read from an HttpsURLConnection.
HttpsURLConnection.getContent() is null
This problem only happens on 4.0 (ICS) and above. On 2.0, 3.0 etc the code works fine.
I am doing my network…

James
- 371
- 4
- 3
0
votes
2 answers
Establishing the URLConnection to another web application does not work with URLConnection .connect()?
Here is the code i am using the open the URLConnection to another webapllication
try {
URL url = new URL("https://mySecondWebApp/Cart");
HttpsURLConnection conn1 = (HttpsURLConnection) url.openConnection();//line1
conn1 .connect();//line 2…

M Sach
- 33,416
- 76
- 221
- 314
0
votes
1 answer
Android: HttpsUrlConnection and Pinset Example
I was watching Google I/O 2012's Security and Privacy in Android Apps. At around 37:55, Kenny Root talks about certificate pinning and tells us to visit the docs for HttpsUrlConnection to see how to use a pinset.
Unfortunately my Google-fu is off…

jww
- 97,681
- 90
- 411
- 885
-1
votes
3 answers
Why I can not read some https pages with java code?
I write a java program like I saw here
How to read the https page content using java?
but for some sites the code does not work.
I got Error Server returned HTTP response code: 403 for URL:…

alin
- 27
- 3
-1
votes
1 answer
Using Httpsurlconnection to connect to server (SSL)
I was attempting to switch from a self-signed certificate to a well known CA (by Let's Encrypted). The original code below works well to connect from the Android app to the server by first passing a JSON e.g. {"name": "xxx"}, while the server echoes…

blossomvy
- 55
- 10
-1
votes
2 answers
Connecting to an HTTPS connection from Java
I want to connect to an https url https://www.ovh.com/cgi-bin/sms/http2sms.cgi, I used the following code:
URL ovhUrl = new URL("https://www.ovh.com/cgi-bin/sms/http2sms.cgi");
HttpsURLConnection connection =…

hakuna matata
- 3,243
- 13
- 56
- 93
-2
votes
1 answer
Why server returns me the Response Code 403 for a valid file in java?
I want to get the Content Length of this file by…

Hadi
- 544
- 1
- 8
- 28
-2
votes
1 answer
Unauthorized bluemail
Good morning, I'm trying to use bluemail on dedicated bluemix.
When I do the HttpsURLConnection and I want to do a mail sending via mail, I throws a getResponseCode = 401 and getResponseMessage = Unauthorized.
I'm trying out all the possible ways…

wagego
- 7
- 2