¡@

Home 

2014/10/16 ¤W¤È 08:11:42

android Programming Glossary: createsocket

Custom SSL handling stopped working on Android 2.2 FroYo

http://stackoverflow.com/questions/2899079/custom-ssl-handling-stopped-working-on-android-2-2-froyo

fix In the custom socket factory the socket creation with createSocket has apparently been changed specifically for the SSLSocketFactory.. implementation. So the old @Override public Socket createSocket Socket socket String host int port boolean autoClose throws.. return getSSLContext .getSocketFactory .createSocket Needs to be changed to @Override public Socket createSocket..

Apache HttpClient on Android producing CertPathValidatorException (IssuerName != SubjectName)

http://stackoverflow.com/questions/4115101/apache-httpclient-on-android-producing-certpathvalidatorexception-issuername

92 at org.apache.http.conn.ssl.SSLSocketFactory.createSocket SSLSocketFactory.java 381 at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection.. host port SSLSocket sslsock SSLSocket sock null sock createSocket if localAddress null localPort 0 we need to bind explicitly.. sslsock @see org.apache.http.conn.scheme.SocketFactory#createSocket public Socket createSocket throws IOException return getSSLContext..

WIFI to WIFI Connectivity using Android

http://stackoverflow.com/questions/4265400/wifi-to-wifi-connectivity-using-android

null Socket client null MEMBER FUNCTIONS public boolean createSocket int port try server new ServerSocket port catch IOException.. smsd mySock new smsd establish the listen socket mySock.createSocket 3005 while true if mySock.listenSocket make new thread Construct..

HTTPS and self-signed certificate issue

http://stackoverflow.com/questions/5947162/https-and-self-signed-certificate-issue

null new TrustManager tm null @Override public Socket createSocket Socket socket String host int port boolean autoClose throws.. UnknownHostException return sslContext.getSocketFactory .createSocket socket host port autoClose @Override public Socket createSocket.. socket host port autoClose @Override public Socket createSocket throws IOException return sslContext.getSocketFactory .createSocket..

ignore ssl errors in DefaultHttpClient

http://stackoverflow.com/questions/7229929/ignore-ssl-errors-in-defaulthttpclient

null new TrustManager tm null @Override public Socket createSocket Socket socket String host int port boolean autoClose throws.. UnknownHostException return sslContext.getSocketFactory .createSocket socket host port autoClose @Override public Socket createSocket.. socket host port autoClose @Override public Socket createSocket throws IOException return sslContext.getSocketFactory .createSocket..

Android: Making Https Request

http://stackoverflow.com/questions/7622004/android-making-https-request

super null sslContext context @Override public Socket createSocket Socket socket String host int port boolean autoClose throws.. UnknownHostException return sslContext.getSocketFactory .createSocket socket host port autoClose @Override public Socket createSocket.. socket host port autoClose @Override public Socket createSocket throws IOException return sslContext.getSocketFactory .createSocket..

Https Connection Android

http://stackoverflow.com/questions/995514/https-connection-android

catch Exception e e.printStackTrace public Socket createSocket throws IOException return FACTORY.createSocket TODO add other.. Socket createSocket throws IOException return FACTORY.createSocket TODO add other methods like createSocket and getDefaultCipherSuites.. return FACTORY.createSocket TODO add other methods like createSocket and getDefaultCipherSuites . Hint they all just make a call..

Custom SSL handling stopped working on Android 2.2 FroYo

http://stackoverflow.com/questions/2899079/custom-ssl-handling-stopped-working-on-android-2-2-froyo

thanks to a helpful Seesmic developer willing to share the fix In the custom socket factory the socket creation with createSocket has apparently been changed specifically for the SSLSocketFactory implementation. So the old @Override public Socket createSocket.. has apparently been changed specifically for the SSLSocketFactory implementation. So the old @Override public Socket createSocket Socket socket String host int port boolean autoClose throws IOException UnknownHostException return getSSLContext .getSocketFactory.. host int port boolean autoClose throws IOException UnknownHostException return getSSLContext .getSocketFactory .createSocket Needs to be changed to @Override public Socket createSocket Socket socket String host int port boolean autoClose throws..

Apache HttpClient on Android producing CertPathValidatorException (IssuerName != SubjectName)

http://stackoverflow.com/questions/4115101/apache-httpclient-on-android-producing-certpathvalidatorexception-issuername

org.apache.http.conn.ssl.AbstractVerifier.verify AbstractVerifier.java 92 at org.apache.http.conn.ssl.SSLSocketFactory.createSocket SSLSocketFactory.java 381 at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection DefaultClientConnectionOperator.java.. params InetSocketAddress remoteAddress new InetSocketAddress host port SSLSocket sslsock SSLSocket sock null sock createSocket if localAddress null localPort 0 we need to bind explicitly if localPort 0 localPort 0 indicates any InetSocketAddress.. connTimeout sslsock.setSoTimeout soTimeout return sslsock @see org.apache.http.conn.scheme.SocketFactory#createSocket public Socket createSocket throws IOException return getSSLContext .getSocketFactory .createSocket @see org.apache.http.conn.scheme.SocketFactory#isSecure..

WIFI to WIFI Connectivity using Android

http://stackoverflow.com/questions/4265400/wifi-to-wifi-connectivity-using-android

public final class smsd MEMBER VARIABLES ServerSocket server null Socket client null MEMBER FUNCTIONS public boolean createSocket int port try server new ServerSocket port catch IOException e System.out.println Could not listen on port port System.exit.. true public static void main String argv throws Exception smsd mySock new smsd establish the listen socket mySock.createSocket 3005 while true if mySock.listenSocket make new thread Construct an object to process the SMS request message. SMSRequest..

HTTPS and self-signed certificate issue

http://stackoverflow.com/questions/5947162/https-and-self-signed-certificate-issue

getAcceptedIssuers return null sslContext.init null new TrustManager tm null @Override public Socket createSocket Socket socket String host int port boolean autoClose throws IOException UnknownHostException return sslContext.getSocketFactory.. String host int port boolean autoClose throws IOException UnknownHostException return sslContext.getSocketFactory .createSocket socket host port autoClose @Override public Socket createSocket throws IOException return sslContext.getSocketFactory .createSocket.. return sslContext.getSocketFactory .createSocket socket host port autoClose @Override public Socket createSocket throws IOException return sslContext.getSocketFactory .createSocket And I use it as follows public HttpClient getHttpClient..

ignore ssl errors in DefaultHttpClient

http://stackoverflow.com/questions/7229929/ignore-ssl-errors-in-defaulthttpclient

getAcceptedIssuers return null sslContext.init null new TrustManager tm null @Override public Socket createSocket Socket socket String host int port boolean autoClose throws IOException UnknownHostException return sslContext.getSocketFactory.. String host int port boolean autoClose throws IOException UnknownHostException return sslContext.getSocketFactory .createSocket socket host port autoClose @Override public Socket createSocket throws IOException return sslContext.getSocketFactory .createSocket..

Android: Making Https Request

http://stackoverflow.com/questions/7622004/android-making-https-request

KeyStoreException UnrecoverableKeyException super null sslContext context @Override public Socket createSocket Socket socket String host int port boolean autoClose throws IOException UnknownHostException return sslContext.getSocketFactory.. String host int port boolean autoClose throws IOException UnknownHostException return sslContext.getSocketFactory .createSocket socket host port autoClose @Override public Socket createSocket throws IOException return sslContext.getSocketFactory .createSocket.. return sslContext.getSocketFactory .createSocket socket host port autoClose @Override public Socket createSocket throws IOException return sslContext.getSocketFactory .createSocket Excellent article here http javaskeleton.blogspot.com..

Https Connection Android

http://stackoverflow.com/questions/995514/https-connection-android

null tm new SecureRandom FACTORY context.getSocketFactory catch Exception e e.printStackTrace public Socket createSocket throws IOException return FACTORY.createSocket TODO add other methods like createSocket and getDefaultCipherSuites . Hint.. catch Exception e e.printStackTrace public Socket createSocket throws IOException return FACTORY.createSocket TODO add other methods like createSocket and getDefaultCipherSuites . Hint they all just make a call to member FACTORY FullX509TrustManager.. public Socket createSocket throws IOException return FACTORY.createSocket TODO add other methods like createSocket and getDefaultCipherSuites . Hint they all just make a call to member FACTORY FullX509TrustManager is a class that implements..