javax.net.ssl
Class HttpsURLConnection
HttpURLConnection
javax.net.ssl.HttpsURLConnection
public abstract class HttpsURLConnection
extends HttpURLConnection
A URL connection that connects via the
Secure Socket Layer
(
SSL) for HTTPS connections.
This class may be used in the same way as
HttpURLConnection
, and it will transparently negotiate the SSL
connection.
- Casey Marshall (rsdio@metastatic.org)
hostnameVerifier
protected HostnameVerifier hostnameVerifier
The hostname verifier used for this connection.
HttpsURLConnection
protected HttpsURLConnection(URL url)
throws IOException
Creates a new HTTPS URL connection.
url
- The URL of the connection being established.
getCipherSuite
public abstract String getCipherSuite()
Returns the cipher name negotiated for this connection.
getDefaultHostnameVerifier
public static HostnameVerifier getDefaultHostnameVerifier()
Returns the default hostname verifier used in all new
connections.
- The default hostname verifier.
getDefaultSSLSocketFactory
public static SSLSocketFactory getDefaultSSLSocketFactory()
Returns the default SSL socket factory used in all new
connections.
- The default SSL socket factory.
getHostnameVerifier
public HostnameVerifier getHostnameVerifier()
Returns the current hostname verifier for this instance.
getLocalCertificates
public abstract Certificate[] getLocalCertificates()
Returns the certificates used on the local side in this
connection.
getSSLSocketFactory
public SSLSocketFactory getSSLSocketFactory()
Returns the current SSL socket factory for this instance.
- The current SSL socket factory.
getServerCertificates
public abstract Certificate[] getServerCertificates()
throws SSLPeerUnverifiedException
Returns the certificates sent by the other party.
setDefaultHostnameVerifier
public static void setDefaultHostnameVerifier(HostnameVerifier newDefault)
Sets the default hostname verifier to be used in all new
connections.
newDefault
- The new default hostname verifier.
setDefaultSSLSocketFactory
public static void setDefaultSSLSocketFactory(SSLSocketFactory newDefault)
Sets the default SSL socket factory to be used in all new
connections.
newDefault
- The new socket factory.
setHostnameVerifier
public void setHostnameVerifier(HostnameVerifier hostnameVerifier)
Sets the hostname verifier for this instance.
hostnameVerifier
- The new verifier.
setSSLSocketFactory
public void setSSLSocketFactory(SSLSocketFactory factory)
Sets the SSL socket factory for this instance.
factory
- The new factory.