Questions tagged [httpsurlconnection]
329 questions
3
votes
0 answers
POSTing JSON with HttpsURLConnection & OutputStreamWriter fails
I'm using Processing 2.0.2 and importing java's java.net,javax.net, and java.io classes.
I'm trying to send a JSONObject to "https://www.bitstamp.net/api/balance/".
The JSONObject contains login info. I create it with this function:
JSONObject…

Steven Uray
- 31
- 2
3
votes
2 answers
How to set the list of ciphers and protocols to be used for sockets created by using HttpsURLConnection?
The normal way to get an SSLSocketFactory would be to initialize a new SSLContext with a TrustManager, KeyManager and SecureRandom and use the getSocketFactory() method. However, this does not allow me to enable the required cipher suites or…

varrunr
- 845
- 1
- 11
- 19
3
votes
0 answers
HttpsURLConnection not returning 401 in Android
I've run into what seems to be a very strange problem. I'm using the HttpsURLConnection class in my Android app, and doing authentication using the Authenticator class.
I can connect to a web service with inputted username and password, and get a…

Jonny
- 2,663
- 1
- 24
- 24
3
votes
1 answer
Android, HttpsUrlConnection: POST Parameters & Password to receive InputStream
Hopefully some of you can help me with my "brain-deadlock".
(just for the understanding) I'm trying to receive a database by using a php-script. Therefore I have to call a webadress/server which gives me access to the php-script only if I'm using a…

njsmecho
- 45
- 6
2
votes
0 answers
Java jdk 1.8.0_321 SNI getting overwritten by hostname
One of the server my client application connects to is going to require SNI sent in requests. They are going to host multiple apps on same host and port.
My app Jdk version - 1.8.0_321
I updated my code to add SNI through SSLSocketFactory. Now I am…

thavala
- 21
- 1
2
votes
3 answers
How to change a HttpsURLConnection GET to be a POST request?
I'm really new to android (programming in general), but I'm inherit a project that was created by another person, I know this may be simple for a lot of you guys but Im lost with trying to change the below piece of code.
What I need to do is to…

Carlos Melendez
- 83
- 5
2
votes
1 answer
Android keep trying POST until it goes through
I have a POST message I absolutely have to send on Android in a given circumstance, to the point I would like it to keep trying until it completes. I was under the understanding that setting:
urlConnection.setConnectTimeout(0);
would keep trying…

Geordie Wicks
- 1,065
- 1
- 11
- 27
2
votes
1 answer
Server Connectivity Issue in Android 10
We are attempting a Server communication with "HttpsURLConnection" object, where we have set the "connection" property of the request Object to "close" [setRequestProperty("Connection", "close")]. The above setting was working fine until in Android…

John Ruban Singh
- 1,284
- 14
- 19
2
votes
1 answer
How to send JSON data to API using HttpsURLConnection on Android?
How can I send JSON data using HttpsURLConnection to my API ?, this is my code
URL endpoint = new URL("https://api.url.com/api/token/");
// Create connection
HttpsURLConnection myConnection = (HttpsURLConnection) endpoint.openConnection();
…

Alex Onofre
- 345
- 1
- 3
- 17
2
votes
1 answer
Java bug - Can't add Authorization to HttpURLConnection set/addRequestProperty()
I'm trying to add the Authorization to the request in my HttpURLConnection. I can add other properties, like Content-type or even custom properties, but when I try to add the Authorization property it just doesn't add it. This is my code:
try {
…

MyName
- 23
- 2
2
votes
0 answers
httpclient accepts untrusted certificates by default
I have developed a small code in Java with httpclient 4.5.6 library :
public class httpclient_test1_valid {
public static void main(String[] args) {
try {
System.setProperty("javax.net.debug", "all");
…

ericb
- 21
- 2
2
votes
0 answers
Accessing HTTPS sites without any certification Java
I want to access a https site in my java code. First I used this code:
URL url = new URL("https://an-example.com");
HttpsURLConnection connection = (HttpsURLConnection)url.openConnection();
…

Kian
- 211
- 1
- 3
- 17
2
votes
1 answer
HttpUrlConnection to HttpsUrlConnection, can i just add the 's'?
I have developed an android application that is successfully sending data from my mobile application to my REST service and then to a database using httpurlconnection. However, I have been asked that I use httpsurlconnection as the REST service will…

TheAlmac2
- 193
- 2
- 15
2
votes
4 answers
SSLHandshakeException when sending POST request via https
I tryed to send a POST request to a remote secure server ( https call).
First i used the OkHTTP lib to make the call, as this lib worked to make http calls in a previous app, but with https it does not work anymore, see my previous post : Cannot…

Marech
- 157
- 12
2
votes
1 answer
Test for SSL attacks - possible to extract certificate of server after SSLException?
For a project, I want to test if anyone is tampering with the SSL connection.
The HttpsUrlConnection is using a SSLContext with a pinned the certificate.
My question is: in case I get an SSLException, e.g. someones is trying to forge a wrong…

soey
- 1,113
- 11
- 16