sslsocketfactory

How to build a SSLSocketFactory from PEM certificate and key without converting to keystore?

删除回忆录丶 提交于 2019-12-03 03:37:05
I'm given a self-signed client certificate kit that is to be used to access a server via HTTPS. The kit consists of the following PEM files: client.crt (client certificate) client.key (client private key) ca.crt (CA certificate) One way to solve the task is to generate a Java keystore: Use openssl to convert client certificate and key to PKCS12 keystore Use keytool to import CA certificate to the store ... and then use code like the following to build SSLSocketFactory instance: InputStream stream = new ByteArrayInputStream(pksData); KeyStore keyStore = KeyStore.getInstance("PKCS12"); keyStore

Java Exception on SSLSocket creation

被刻印的时光 ゝ 提交于 2019-12-01 13:12:13
问题 In the code: System.setProperty("javax.net.ssl.trustStore", cacerts); System.setProperty("javax.net.ssl.trustStorePassword", pwdCacerts); SSLSocketFactory sslsocketfactory = (SSLSocketFactory) SSLSocketFactory.getDefault(); SSLSocket sslsocket = (SSLSocket) sslsocketfactory.createSocket("localhost", port); I obtain a Java Exception: java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security

Now that SSLSocketFactory is deprecated on Android, what would be the best way to handle Client Certificate Authentication?

余生长醉 提交于 2019-11-30 00:23:20
I am working on an Android app that requires Client Certificate Authentication (with PKCS 12 files). Following the deprecation of all that's apache.http.* , we have started a pretty big work of refactoring on our network layer, and we have decided to go with OkHttp as a replacement, and so far I like that very much. However, I haven't found any other way to handle client certificate auth without using SSLSocketFactory , with OkHttp or anything else for that matter. So what would be the best course of action in this particular case? Is there another way with OkHttp to handle this sort of

How do I tell the TLS version in Android Volley

纵然是瞬间 提交于 2019-11-29 06:55:35
My project has been using Android Volley network framework for a long time, but recently I found a SSL 3.0 protocol bug published on the Internet. I want to know how can I find out what's the TLS version my project used, and how to confirm whether the library is updated. Here is my source code fragment: HttpStack stack = new HurlStack(); Network network = new BasicNetwork(stack); mHttpRequestQueue = new RequestQueue(new NoCache(), network); mHttpRequestQueue.start(); I think the point is in HurlStack class, and it depends on org.apache.http package, but I can't figure out where TLS/SSL

How do I tell the TLS version in Android Volley

本秂侑毒 提交于 2019-11-28 00:17:44
问题 My project has been using Android Volley network framework for a long time, but recently I found a SSL 3.0 protocol bug published on the Internet. I want to know how can I find out what's the TLS version my project used, and how to confirm whether the library is updated. Here is my source code fragment: HttpStack stack = new HurlStack(); Network network = new BasicNetwork(stack); mHttpRequestQueue = new RequestQueue(new NoCache(), network); mHttpRequestQueue.start(); I think the point is in

Secret Key SSL Socket connections in Java

我与影子孤独终老i 提交于 2019-11-27 21:36:39
I'm working on encrypting a tcp connection between a server and a client. In the course of research and testing I'm leaning towards using secret key encryption. My problem is that I cannot find any tutorials on how to implement this feature. The tutorials I have found revolve around one-shot https requests, all I need is a SSL Socket. The code I've written so far is below. I'm almost certain that it needs to be extended, I just don't know how. Any help is appreciated. private ServerSocketFactory factory; private SSLServerSocket serverSocket; factory = SSLServerSocketFactory.getDefault();

an unsafe implementation of the interface X509TrustManager from google

烈酒焚心 提交于 2019-11-27 19:56:09
I hava an app in Google Play, I received a mail from Google saying that: Your app(s) listed at the end of this email use an unsafe implementation of the interface X509TrustManager. Specifically, the implementation ignores all SSL certificate validation errors when establishing an HTTPS connection to a remote host, thereby making your app vulnerable to man-in-the-middle attacks. To properly handle SSL certificate validation, change your code in the checkServerTrusted method of your custom X509TrustManager interface to raise either CertificateException or IllegalArgumentException whenever the

Disable SSL as a protocol in HttpsURLConnection

本小妞迷上赌 提交于 2019-11-26 22:39:00
问题 Due to the POODLE vulnerability, my server, hosted in Amazon AWS does no longer support SSLv3. As a result, the first HTTPS connection my Android app does against the server results in an error when the connection was being established. Error reading server response: javax.net.ssl.SSLHandshakeException: javax.net.ssl.SSLProtocolException: SSL handshake aborted: ssl=0x77d8ab68: Failure in SSL library, usually a protocol error error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert

Secret Key SSL Socket connections in Java

穿精又带淫゛_ 提交于 2019-11-26 20:44:20
问题 I'm working on encrypting a tcp connection between a server and a client. In the course of research and testing I'm leaning towards using secret key encryption. My problem is that I cannot find any tutorials on how to implement this feature. The tutorials I have found revolve around one-shot https requests, all I need is a SSL Socket. The code I've written so far is below. I'm almost certain that it needs to be extended, I just don't know how. Any help is appreciated. private

an unsafe implementation of the interface X509TrustManager from google

不问归期 提交于 2019-11-26 20:03:29
问题 I hava an app in Google Play, I received a mail from Google saying that: Your app(s) listed at the end of this email use an unsafe implementation of the interface X509TrustManager. Specifically, the implementation ignores all SSL certificate validation errors when establishing an HTTPS connection to a remote host, thereby making your app vulnerable to man-in-the-middle attacks. To properly handle SSL certificate validation, change your code in the checkServerTrusted method of your custom