ssl - HttpsUrlConnection with SSLSocketFactory class takes too long to connect in Android -
I want to use the TLS protocol in Android with HttpsUrlConnection . For this, I'm overriding the SSLSocketFactory class and setting the TLS protocol by using the setEnabledProtocol () method. Then I am using SSLSocketFactory in HttpsUrlConnection connection.setSSLSocketFactory () method.
HTPS URL connection connection = (HTPS URL connection) url.openConnection (); SSLSocketFactoryEx SocketFenture = New SSLSocketFactoryEx (); Conn.setSSLSocketFactory (socketFactory); Conn.connect (); Here SSLSocketFactoryEx has been derived from my custom class SSLSocketFactory class. Inside the SSLSocketFactoryEx class, I am setting the setEnabledProtocol () method with the TLS protocol.
The problem now occurs when I take more than one second to connect to SSLSocketFactory class, HttpsUrlConnection . According to the link given below, there is a bug related to reverse DNS in Android, due to which it takes time. I followed the approach described to fix this issue but still it is slow
Is there any way to improve performance?
Comments
Post a Comment