| |
|
| java.net.HttpURLConnection javax.net.ssl.HttpsURLConnection
HttpsURLConnection | abstract public class HttpsURLConnection extends HttpURLConnection (Code) | | HttpsURLConnection extends HttpURLConnection
with support for https-specific features.
See
http://www.w3.org/pub/WWW/Protocols/ and
RFC 2818
for more details on the
https specification.
This class uses HostnameVerifier and
SSLSocketFactory .
There are default implementations defined for both classes.
However, the implementations can be replaced on a per-class (static) or
per-instance basis. All new HttpsURLConnection s instances
will be assigned
the "default" static values at instance creation, but they can be overriden
by calling the appropriate per-instance set method(s) before
connect ing.
since: 1.4 version: 1.33 |
Constructor Summary | |
protected | HttpsURLConnection(URL url) Creates an HttpsURLConnection using the
URL specified. |
HttpsURLConnection | protected HttpsURLConnection(URL url)(Code) | | Creates an HttpsURLConnection using the
URL specified.
Parameters: url - the URL |
getCipherSuite | abstract public String getCipherSuite()(Code) | | Returns the cipher suite in use on this connection.
the cipher suite throws: IllegalStateException - if this method is called beforethe connection has been established. |
getLocalCertificates | abstract public java.security.cert.Certificate[] getLocalCertificates()(Code) | | Returns the certificate(s) that were sent to the server during
handshaking.
Note: This method is useful only when using certificate-based
cipher suites.
When multiple certificates are available for use in a
handshake, the implementation chooses what it considers the
"best" certificate chain available, and transmits that to
the other side. This method allows the caller to know
which certificate chain was actually sent.
an ordered array of certificates,with the client's own certificate first followed by anycertificate authorities. If no certificates were sent,then null is returned. throws: IllegalStateException - if this method is called beforethe connection has been established. See Also: HttpsURLConnection.getLocalPrincipal() |
getLocalPrincipal | public Principal getLocalPrincipal()(Code) | | Returns the principal that was sent to the server during handshaking.
Note: Subclasses should override this method. If not overridden, it
will default to returning the X500Principal of the end-entity certificate
that was sent to the server for certificate-based ciphersuites or,
return null for non-certificate based ciphersuites, such as Kerberos.
the principal sent to the server. Returns an X500Principalof the end-entity certificate for X509-based cipher suites, andKerberosPrincipal for Kerberos cipher suites. If no principal wassent, then null is returned. throws: IllegalStateException - if this method is called beforethe connection has been established. See Also: HttpsURLConnection.getLocalCertificates() See Also: HttpsURLConnection.getPeerPrincipal() since: 1.5 |
getPeerPrincipal | public Principal getPeerPrincipal() throws SSLPeerUnverifiedException(Code) | | Returns the server's principal which was established as part of
defining the session.
Note: Subclasses should override this method. If not overridden, it
will default to returning the X500Principal of the server's end-entity
certificate for certificate-based ciphersuites, or throw an
SSLPeerUnverifiedException for non-certificate based ciphersuites,
such as Kerberos.
the server's principal. Returns an X500Principal of theend-entity certiticate for X509-based cipher suites, andKerberosPrincipal for Kerberos cipher suites. throws: SSLPeerUnverifiedException - if the peer was not verified throws: IllegalStateException - if this method is called beforethe connection has been established. See Also: HttpsURLConnection.getServerCertificates() See Also: HttpsURLConnection.getLocalPrincipal() since: 1.5 |
getServerCertificates | abstract public java.security.cert.Certificate[] getServerCertificates() throws SSLPeerUnverifiedException(Code) | | Returns the server's certificate chain which was established
as part of defining the session.
Note: This method can be used only when using certificate-based
cipher suites; using it with non-certificate-based cipher suites,
such as Kerberos, will throw an SSLPeerUnverifiedException.
an ordered array of server certificates,with the peer's own certificate first followed byany certificate authorities. throws: SSLPeerUnverifiedException - if the peer is not verified. throws: IllegalStateException - if this method is called beforethe connection has been established. See Also: HttpsURLConnection.getPeerPrincipal() |
setDefaultHostnameVerifier | public static void setDefaultHostnameVerifier(HostnameVerifier v)(Code) | | Sets the default HostnameVerifier inherited by a
new instance of this class.
If this method is not called, the default
HostnameVerifier assumes the connection should not
be permitted.
Parameters: v - the default host name verifier throws: IllegalArgumentException - if the HostnameVerifier parameter is null. throws: SecurityException - if a security manager exists and itscheckPermission method does not allowSSLPermission("setHostnameVerifier") See Also: HttpsURLConnection.getDefaultHostnameVerifier() |
setDefaultSSLSocketFactory | public static void setDefaultSSLSocketFactory(SSLSocketFactory sf)(Code) | | Sets the default SSLSocketFactory inherited by new
instances of this class.
The socket factories are used when creating sockets for secure
https URL connections.
Parameters: sf - the default SSL socket factory throws: IllegalArgumentException - if the SSLSocketFactoryparameter is null. throws: SecurityException - if a security manager exists and itscheckSetFactory method does not allowa socket factory to be specified. See Also: HttpsURLConnection.getDefaultSSLSocketFactory() |
|
|
|