Questions tagged [httpsurlconnection]

329 questions
0
votes
0 answers

URLConnection setRequestProperty content-length not right

I want to send information to the server, but it is only part of the information seen by the Content-Length is not correct. My code: private static String boundary = `BOUNDARY`; private static String break = `\r\n`; String url = `https://`; URL…
0
votes
1 answer

FileNotFoundException on HttpsURLConnection with POST and unmutable doOutput variable

I'm trying to POST some data to an https url, in my android application, in order to get a json format response. I'm facing two problems: is = conn.getInputStream(); throws java.io.FileNotFoundException I don't get if i do something wrong with…
kalup
  • 61
  • 1
  • 6
0
votes
2 answers

HttpsURLConnection - Intermittent Connection Refused errors

I am connecting to a web service via a java application and the HttpsURLConnection implementation. I open the connection, use try with resource block to open (and close when finished) the input stream and input stream reader, and then call…
0
votes
1 answer

Fail to get Responsecode from HttpsURLConnection

I am trying to get the response code from a URL: final SSLContext sslContext = SSLContext.getInstance( "SSL" ); Utils.noCerts(sslContext); SSLSocketFactory socketFactory = sslContext.getSocketFactory(); URL url = new…
dev
  • 1,477
  • 5
  • 18
  • 43
0
votes
2 answers

How to write image or file to httpsurlconnection?

I got image from gallery intent. That is i got uri for an image in android. How to write an image or file to httpsurlconnection to upload to server.please help.
Strange
  • 59
  • 1
  • 8
0
votes
0 answers

Cannot login to website with Android application

I am trying to connect to my University's website using an Android app I am writing in Eclipse (Android v. 4.3), provide my credentials, and then stay logged in to download my class schedule. I have searched these forums for days and tried many…
0
votes
1 answer

HttpsUrlConnection with Authorization seems to cut off url parameter in GET request

I'm trying to establish a Connection via HTTPS. I also set the "Authorization" property in the Request Header to Basic and provide an encoded auth string accordingly. I checked with the Firefox Plugin HttpRequester and everythign works fine, which…
haferblues
  • 2,155
  • 4
  • 26
  • 39
0
votes
3 answers

Android - HttpsURLConnection not working

I wrote this AsyncTask for sending small pieces of json through a HttpsURLConnection on an Android Phone. It's not throwing any exceptions in LogCat. But my Node.JS server(HTTPS!) does not receive any requests. What's wrong with this code? Thanks…
raptor
  • 760
  • 7
  • 18
0
votes
1 answer

Your browser sent a request that this server could not understand HttpsURLConnection

I am making a login app to retreive some information from the link that appears in the code. My problem is that I'm getting a "400 Bad request. Your browser sent a request that this server could not understand. [...] Server at idp.tut.fi Port 443"…
dgarciale
  • 3
  • 2
0
votes
1 answer

How to access a HTTPS url from a java application

I know this is a very basic question, but some how I have managed to not find a solution to this problem. I have a java class that has a main method. In that method, I try to access an https url as below: package helloworld; import…
Aspirant
  • 1,934
  • 4
  • 25
  • 44
0
votes
2 answers

java.net.ProtocolException: Server redirected too many times (20)

I've this code: import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import javax.net.ssl.HttpsURLConnection; public class Demo2 { public static void main(String[] args) { …
Hoddix
  • 1
  • 1
  • 1
  • 3
0
votes
0 answers

getting java.net.SocketException: Software caused connection abort: recv failed during sslSocket.startHandshake();

I am getting the exception at client side, even though I set all the properties of the keystore like protocol, keystoretyoe, password everything at client side when I try to access the url using httpsurlconnection. But If I trustAll,…
0
votes
1 answer

How to get CertPathValidatorResult in checkServerTrusted() of TrustManager?

When the checkServerTrusted method of classes implementing X509TrustManager is invoked, I need to get ALL validation errors that are associated with a certificate chain including Certificate path validation problems. e.g CA not trusted Certificate…
varrunr
  • 845
  • 1
  • 11
  • 19
0
votes
1 answer

Eclipse plugin dev, how to stop HttpsURLConnection of poping up user/password window when I connect

JDK IBM 1.6 Eclipse 3.6.2 Connect to a server with following code. URL urlTemplate = new URL(uri); uc = (HttpURLConnection) urlTemplate.openConnection(); when connecting with wrong credential, it will pop up a window to enter correct credential…
0
votes
1 answer

android HttpsURLConnection not initializing

I have the following code for connecting to a url. My problem, is that when I run it in debug, I see that connected = false and none of the other parameters that I am trying to set are working (such as timeout). Can anyone help me with this? What am…
Meir
  • 1,943
  • 5
  • 22
  • 38
1 2 3
21
22