public class SSLConfig extends Object
getSSLSocketFactory()
returns a properly configured object that you can use
to create sockets.
If you have an HttpsURLConnection
, call the convenience method
apply(HttpsURLConnection)
(before calling URLConnection.connect()
)
to apply the appropriate security settings.
Modifier and Type | Class and Description |
---|---|
static class |
SSLConfig.LoadException |
Constructor and Description |
---|
SSLConfig() |
Modifier and Type | Method and Description |
---|---|
static void |
apply(HttpsURLConnection conn)
Apply security settings to an
HttpsURLConnection . |
static SSLSocketFactory |
getSSLSocketFactory() |
static X509TrustManager |
getTrustManager() |
public static void apply(HttpsURLConnection conn) throws SSLException
HttpsURLConnection
. Make sure you
haven't called URLConnection.connect()
yet.SSLException
public static X509TrustManager getTrustManager()
public static SSLSocketFactory getSSLSocketFactory()