httpsurlconnection

How to do an HTTPS POST from Android?

不打扰是莪最后的温柔 提交于 2019-11-27 01:09:45
I want to do a HTTPS post method to send some data from my android app to my website. I used HttpURLConnection first and it's working fine with my HTTP URL. My production website is on HTTPS and I want to send the same POST using HttpsURLConnection . Can someone help me use the class properly? I found some source at this link : KeyStore keyStore = ...; TrustManagerFactory tmf = TrustManagerFactory.getInstance("X509"); tmf.init(keyStore); SSLContext context = SSLContext.getInstance("TLS"); context.init(null, tmf.getTrustManagers(), null); URL url = new URL("https://www.example.com/");

How to override the cipherlist sent to the server by Android when using HttpsURLConnection?

不想你离开。 提交于 2019-11-26 12:43:38
问题 During TLS negotiation, clients send a list of supported ciphers to the server, the server picks one, and encryption starts. I want to change this cipherlist sent to the server by Android, when I\'m using HttpsURLConnection for communication. I know that I can use setSSLSocketFactory on the HttpsURLConnection object to set it up to use a SSLSocketFactory . This is useful when I want to change the trustmanager etc used by the SSLSocket returned by the SSLSocketFactory . I know that in general

How to do an HTTPS POST from Android?

一笑奈何 提交于 2019-11-26 12:26:45
问题 I want to do a HTTPS post method to send some data from my android app to my website. I used HttpURLConnection first and it\'s working fine with my HTTP URL. My production website is on HTTPS and I want to send the same POST using HttpsURLConnection . Can someone help me use the class properly? I found some source at this link: KeyStore keyStore = ...; TrustManagerFactory tmf = TrustManagerFactory.getInstance(\"X509\"); tmf.init(keyStore); SSLContext context = SSLContext.getInstance(\"TLS\");