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.
Author:- Casey Marshall (rsdio@metastatic.org)
hostnameVerifier
protected HostnameVerifier hostnameVerifier
The hostname verifier used for this connection.
HttpsURLConnection
protected HttpsURLConnection(URL url)
Creates a new HTTPS URL connection.
Parameters:
Throws:
- If the connection cannot be established.
getCipherSuite
public String getCipherSuite()
Returns the cipher name negotiated for this connection.
Returns:
Throws:
- If the connection has not yet been
established.
getDefaultHostnameVerifier
public static HostnameVerifier getDefaultHostnameVerifier()
Returns the default hostname verifier used in all new
connections.
Returns:
- The default hostname verifier.
getDefaultSSLSocketFactory
public static SSLSocketFactory getDefaultSSLSocketFactory()
Returns the default SSL socket factory used in all new
connections.
Returns:
- The default SSL socket factory.
getHostnameVerifier
public HostnameVerifier getHostnameVerifier()
Returns the current hostname verifier for this instance.
Returns:
getLocalCertificates
public Certificate[] getLocalCertificates()
Returns the certificates used on the local side in this
connection.
Returns:
Throws:
- If the connection has not yet been
established.
getSSLSocketFactory
public SSLSocketFactory getSSLSocketFactory()
Returns the current SSL socket factory for this instance.
Returns:
- The current SSL socket factory.
getServerCertificates
public Certificate[] getServerCertificates()
Returns the certificates sent by the other party.
Returns:
Throws:
setDefaultHostnameVerifier
public static void setDefaultHostnameVerifier(javax.net.ssl.HostnameVerifier newDefault)
Sets the default hostname verifier to be used in all new
connections.
Parameters:
Throws:
- If newDefault is null.
- If there is a security manager
currently installed and the caller does not have the SSLPermission "setHostnameVerifier".
setDefaultSSLSocketFactory
public static void setDefaultSSLSocketFactory(javax.net.ssl.SSLSocketFactory newDefault)
Sets the default SSL socket factory to be used in all new
connections.
Parameters:
Throws:
- If newDefault is null.
- If there is a security manager
installed and a call to SecurityManager#checkSetFactory() fails.
setHostnameVerifier
public void setHostnameVerifier(javax.net.ssl.HostnameVerifier hostnameVerifier)
Sets the hostname verifier for this instance.
Parameters:
Throws:
- If hostnameVerifier is
null.
setSSLSocketFactory
public void setSSLSocketFactory(javax.net.ssl.SSLSocketFactory factory)
Sets the SSL socket factory for this instance.
Parameters:
Throws: