httpsurlconnection

Java HttpsURLConnection and TLS 1.2

半城伤御伤魂 提交于 2019-12-17 15:37:35
问题 I read in an article that HttpsURLConnection will transparently negotiate the SSL connection. The official document says: This class uses HostnameVerifier and SSLSocketFactory. There are default implementations defined for both classes. [1] Does that mean once you open a connection with httpsCon = (HttpsURLConnection) url.openConnection(); It is already SSL/TLS encrypted without any more hassle? How can I view and set the TLS version for the standard implementation? (Should be TLS 1.2 for

How to disable SSLv3 in android for HttpsUrlConnection?

99封情书 提交于 2019-12-17 03:09:21
问题 We wrote client application in android which connects with https servers using HttpsUrlConnection apis. Due to Poodle vulnerability, we need to disable SSLv3 from the list of enabled protocols while invoking any request. We followed the guidelines captured by oracle and added following line before invoking url connection java.lang.System.setProperty("https.protocols", "TLSv1"); This solution works fine with normal java program. We got SSLHandShakeException when tried to connect with a server

How to enable or implement logging for HttpsURLConnection traffic on Android? [closed]

感情迁移 提交于 2019-12-12 03:57:28
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . 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

How to call the github API form HttpsURLConnection in java

眉间皱痕 提交于 2019-12-12 03:47:16
问题 I need to change my branch named testingProtectedBranch1 as a protected branch with providing the following parameters on required_status_check : include_admins= true, strict= true, context= continuous-integration/travis-ci restrictions: null required_pull_request_reviews: include_admins=false here is my code and the access token ( the variable token ) is provided by the user at the runtime. public void setMasterBranchAsProtected() throws Exception{ String URLForCallingTheBranchAPI="https:/

How to access a HTTPS url from a java application

廉价感情. 提交于 2019-12-11 21:26:16
问题 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 java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URL; import javax.net.ssl.HttpsURLConnection; public class ConnectHttps { public static void main(String[] argsd) { System.out.println(

java.net.protocolException with HttpsURLConnection in android

亡梦爱人 提交于 2019-12-11 13:52:58
问题 I am trying to create a FlickR request through HttpURL connection and I get a java.net.protocolException on con.getInputStream() Thread thread = new Thread(new Runnable(){ @Override public void run() { try { URL turl = new URL(url); HttpsURLConnection con = (HttpsURLConnection)turl.openConnection(); InputStream inputStream = con.getInputStream(); xml = getStringFromInputStream(inputStream); uihandler.post(obj.updateRunnable); } catch (Exception e) { e.printStackTrace(); } } }); the url is

HttpsUrlConnection EOFException

空扰寡人 提交于 2019-12-11 06:52:13
问题 I'm using the following code for post requests public String executeHttpPost(String uri, String data) { HttpURLConnection conn = null; URL url = null; String s = null; try { url = new URL(uri); conn = (HttpURLConnection) url.openConnection(); if (conn instanceof HttpsURLConnection) { Log.d("HTTPS", "HttpsUrl"); } conn.setDoOutput(true); conn.setDoInput(true); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); OutputStreamWriter wr =

Connection closed, EOF detected

纵然是瞬间 提交于 2019-12-11 05:33:41
问题 I want to post some json data from ADFS SSO enabled weblogic server to an https url(jetty server) but I am getting the below exception java.io.IOException: Connection closed, EOF detected at weblogic.socket.JSSEFilterImpl.handleUnwrapResults(JSSEFilterImpl.java:637) at weblogic.socket.JSSEFilterImpl.unwrapAndHandleResults(JSSEFilterImpl.java:515) at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:96) at weblogic.socket.JSSEFilterImpl.doHandshake(JSSEFilterImpl.java:75) at

SSL Client authentication in Android 4.x

独自空忆成欢 提交于 2019-12-07 00:04:19
问题 I would like to create an App which connects to a server. This server uses SSL Client Authentication. The User of the App should be able to choose the certificate and allow the use of it like it is implemented in the browser app. In the browser app the authentication is working as expected, so the certificate I use is valid. When I try to connect in my App I get the following Error: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake terminated: ssl

HTTP/1.1 302 Moved Temporarily - Happens on Android API 16-17

[亡魂溺海] 提交于 2019-12-06 16:01:24
Long story short. I want to download some google sheet files from the internet when my App starts. Here's the situation: Newer Devices: Everything works 100%, no problems, all files downloaded. Older Devices (API 16-17): Downloads first sheet file correctly. Fails to download the second file. I get a HTTP/1.1 302 Moved Temporarily problem and file fails to download itself correctly. I call AsynchTask for both files. AsynchTask runs perfectly and I tried other methods to see if AsynchTask was the problem. In addition, all links are perfectly fine and working. Here is a part of my AsynchTask