¡@

Home 

2014/10/16 ¤W¤È 08:24:33

android Programming Glossary: socketfactory

Accepting a certificate for HTTPs on Android

http://stackoverflow.com/questions/2012497/accepting-a-certificate-for-https-on-android

registry new SchemeRegistry SSLSocketFactory socketFactory SSLSocketFactory.getSocketFactory socketFactory.setHostnameVerifier.. socketFactory SSLSocketFactory.getSocketFactory socketFactory.setHostnameVerifier X509HostnameVerifier hostnameVerifier registry.register.. hostnameVerifier registry.register new Scheme https socketFactory 443 SingleClientConnManager mgr new SingleClientConnManager..

Using client/server certificates for two way authentication SSL socket on Android

http://stackoverflow.com/questions/4064810/using-client-server-certificates-for-two-way-authentication-ssl-socket-on-androi

public void run String line try SSLSocketFactory socketFactory SSLSocketFactory SSLClient.ssl_ctx.getSocketFactory socket.. SSLClient.ssl_ctx.getSocketFactory socket SSLSocket socketFactory.createSocket serverUrl Integer.parseInt serverPort this.input.. SSLSocketFactory to use the certificates SSLSocketFactory socketFactory null socketFactory new SSLSocketFactory SSLSocketFactory.TLS..

Android/Java — How to Create HTTPS Connection?

http://stackoverflow.com/questions/5485415/android-java-how-to-create-https-connection

final SSLSocketFactory socketFactory SSLSocketFactory.getSocketFactory socketFactory.setHostnameVerifier.. socketFactory SSLSocketFactory.getSocketFactory socketFactory.setHostnameVerifier X509HostnameVerifier hostnameVerifier socketFactory.setHostnameVerifier.. X509HostnameVerifier hostnameVerifier socketFactory.setHostnameVerifier SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER..

HTTPS connection with client certificate in an android app

http://stackoverflow.com/questions/7714993/https-connection-with-client-certificate-in-an-android-app

Here is the relavent code for the client SSLSocketFactory socketFactory null public void onCreate Bundle savedInstanceState loadCertificateData.. keyManagerFactory.init keyStore password socketFactory new SSLSocketFactory keyStore catch Exceptions e Actually a.. 80 schRegistry.register new Scheme https socketFactory 443 ClientConnectionManager connectionManager new ThreadSafeClientConnManager..

Problems with https (No peer certificate) in android

http://stackoverflow.com/questions/9531710/problems-with-https-no-peer-certificate-in-android

registry new SchemeRegistry SSLSocketFactory socketFactory SSLSocketFactory.getSocketFactory socketFactory.setHostnameVerifier.. socketFactory SSLSocketFactory.getSocketFactory socketFactory.setHostnameVerifier X509HostnameVerifier hostnameVerifier registry.register.. hostnameVerifier registry.register new Scheme https socketFactory 443 SingleClientConnManager mgr new SingleClientConnManager..

Accepting a certificate for HTTPs on Android

http://stackoverflow.com/questions/2012497/accepting-a-certificate-for-https-on-android

DefaultHttpClient client new DefaultHttpClient SchemeRegistry registry new SchemeRegistry SSLSocketFactory socketFactory SSLSocketFactory.getSocketFactory socketFactory.setHostnameVerifier X509HostnameVerifier hostnameVerifier registry.register.. SchemeRegistry registry new SchemeRegistry SSLSocketFactory socketFactory SSLSocketFactory.getSocketFactory socketFactory.setHostnameVerifier X509HostnameVerifier hostnameVerifier registry.register new Scheme https socketFactory 443 SingleClientConnManager.. socketFactory.setHostnameVerifier X509HostnameVerifier hostnameVerifier registry.register new Scheme https socketFactory 443 SingleClientConnManager mgr new SingleClientConnManager client.getParams registry DefaultHttpClient httpClient new DefaultHttpClient..

Using client/server certificates for two way authentication SSL socket on Android

http://stackoverflow.com/questions/4064810/using-client-server-certificates-for-two-way-authentication-ssl-socket-on-androi

String message Handler.output.println message @Override public void run String line try SSLSocketFactory socketFactory SSLSocketFactory SSLClient.ssl_ctx.getSocketFactory socket SSLSocket socketFactory.createSocket serverUrl Integer.parseInt.. String line try SSLSocketFactory socketFactory SSLSocketFactory SSLClient.ssl_ctx.getSocketFactory socket SSLSocket socketFactory.createSocket serverUrl Integer.parseInt serverPort this.input new BufferedReader new InputStreamReader socket.getInputStream.. keyStore MyPassword .toCharArray initialize SSLSocketFactory to use the certificates SSLSocketFactory socketFactory null socketFactory new SSLSocketFactory SSLSocketFactory.TLS keyStore MyTestPassword2010 trustStore null null Set basic..

Android/Java — How to Create HTTPS Connection?

http://stackoverflow.com/questions/5485415/android-java-how-to-create-https-connection

hostnameVerifier org.apache.http.conn.ssl.SSLSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER final SSLSocketFactory socketFactory SSLSocketFactory.getSocketFactory socketFactory.setHostnameVerifier X509HostnameVerifier hostnameVerifier socketFactory.setHostnameVerifier.. final SSLSocketFactory socketFactory SSLSocketFactory.getSocketFactory socketFactory.setHostnameVerifier X509HostnameVerifier hostnameVerifier socketFactory.setHostnameVerifier SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER.. SSLSocketFactory.getSocketFactory socketFactory.setHostnameVerifier X509HostnameVerifier hostnameVerifier socketFactory.setHostnameVerifier SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER registry.register new Scheme http PlainSocketFactory.getSocketFactory..

HTTPS connection with client certificate in an android app

http://stackoverflow.com/questions/7714993/https-connection-with-client-certificate-in-an-android-app

searching around the internet for various solutions to this. Here is the relavent code for the client SSLSocketFactory socketFactory null public void onCreate Bundle savedInstanceState loadCertificateData private void loadCertificateData try File pfxFiles.. KeyManagerFactory.getInstance KeyManagerFactory.getDefaultAlgorithm keyManagerFactory.init keyStore password socketFactory new SSLSocketFactory keyStore catch Exceptions e Actually a bunch of catch blocks here but shortened private void someMethodInvokedToEstablishAHttpsConnection.. schRegistry.register new Scheme http PlainSocketFactory.getSocketFactory 80 schRegistry.register new Scheme https socketFactory 443 ClientConnectionManager connectionManager new ThreadSafeClientConnManager standardParams schRegistry HttpClient client..

Problems with https (No peer certificate) in android

http://stackoverflow.com/questions/9531710/problems-with-https-no-peer-certificate-in-android

DefaultHttpClient client new DefaultHttpClient SchemeRegistry registry new SchemeRegistry SSLSocketFactory socketFactory SSLSocketFactory.getSocketFactory socketFactory.setHostnameVerifier X509HostnameVerifier hostnameVerifier registry.register.. SchemeRegistry registry new SchemeRegistry SSLSocketFactory socketFactory SSLSocketFactory.getSocketFactory socketFactory.setHostnameVerifier X509HostnameVerifier hostnameVerifier registry.register new Scheme https socketFactory 443 SingleClientConnManager.. socketFactory.setHostnameVerifier X509HostnameVerifier hostnameVerifier registry.register new Scheme https socketFactory 443 SingleClientConnManager mgr new SingleClientConnManager client.getParams registry DefaultHttpClient httpClient new DefaultHttpClient..