public class MySSLSocketFactory
extends cz.msebera.android.httpclient.conn.ssl.SSLSocketFactory
Warning! This omits SSL certificate validation on every device, use with caution
| Constructor and Description |
|---|
MySSLSocketFactory(java.security.KeyStore truststore)
Creates a new SSL Socket Factory with the given KeyStore.
|
| Modifier and Type | Method and Description |
|---|---|
java.net.Socket |
createSocket() |
java.net.Socket |
createSocket(java.net.Socket socket,
java.lang.String host,
int port,
boolean autoClose) |
void |
fixHttpsURLConnection()
Makes HttpsURLConnection trusts a set of certificates specified by the KeyStore
|
static cz.msebera.android.httpclient.conn.ssl.SSLSocketFactory |
getFixedSocketFactory()
Returns a SSlSocketFactory which trusts all certificates
|
static java.security.KeyStore |
getKeystore()
Gets a Default KeyStore
|
static java.security.KeyStore |
getKeystoreOfCA(java.io.InputStream cert)
Gets a KeyStore containing the Certificate
|
static cz.msebera.android.httpclient.impl.client.DefaultHttpClient |
getNewHttpClient(java.security.KeyStore keyStore)
Gets a DefaultHttpClient which trusts a set of certificates specified by the KeyStore
|
connectSocket, connectSocket, connectSocket, createLayeredSocket, createLayeredSocket, createLayeredSocket, createSocket, createSocket, getHostnameVerifier, getSocketFactory, getSystemSocketFactory, isSecure, prepareSocket, setHostnameVerifierpublic MySSLSocketFactory(java.security.KeyStore truststore)
throws java.security.NoSuchAlgorithmException,
java.security.KeyManagementException,
java.security.KeyStoreException,
java.security.UnrecoverableKeyException
truststore - A KeyStore to create the SSL Socket Factory in context ofjava.security.NoSuchAlgorithmException - NoSuchAlgorithmExceptionjava.security.KeyManagementException - KeyManagementExceptionjava.security.KeyStoreException - KeyStoreExceptionjava.security.UnrecoverableKeyException - UnrecoverableKeyExceptionpublic static java.security.KeyStore getKeystoreOfCA(java.io.InputStream cert)
cert - InputStream of the Certificatepublic static java.security.KeyStore getKeystore()
public static cz.msebera.android.httpclient.conn.ssl.SSLSocketFactory getFixedSocketFactory()
public static cz.msebera.android.httpclient.impl.client.DefaultHttpClient getNewHttpClient(java.security.KeyStore keyStore)
keyStore - custom provided KeyStore instancepublic java.net.Socket createSocket(java.net.Socket socket,
java.lang.String host,
int port,
boolean autoClose)
throws java.io.IOException
createSocket in interface cz.msebera.android.httpclient.conn.scheme.LayeredSocketFactorycreateSocket in class cz.msebera.android.httpclient.conn.ssl.SSLSocketFactoryjava.io.IOExceptionpublic java.net.Socket createSocket()
throws java.io.IOException
createSocket in interface cz.msebera.android.httpclient.conn.scheme.SocketFactorycreateSocket in class cz.msebera.android.httpclient.conn.ssl.SSLSocketFactoryjava.io.IOExceptionpublic void fixHttpsURLConnection()