com.sun.net.ssl
Class HttpsURLConnection

java.lang.Object
  |
  +--java.net.URLConnection
        |
        +--java.net.HttpURLConnection
              |
              +--com.sun.net.ssl.HttpsURLConnection

public abstract class HttpsURLConnection
extends HttpURLConnection

HTTP URL connection with support for HTTPS-specific features. See the spec for details.


Field Summary
protected  HostnameVerifier hostnameVerifier
           
protected  SSLSocketFactory sslSocketFactory
           
 
Fields inherited from class java.net.HttpURLConnection
HTTP_ACCEPTED, HTTP_BAD_GATEWAY, HTTP_BAD_METHOD, HTTP_BAD_REQUEST, HTTP_CLIENT_TIMEOUT, HTTP_CONFLICT, HTTP_CREATED, HTTP_ENTITY_TOO_LARGE, HTTP_FORBIDDEN, HTTP_GATEWAY_TIMEOUT, HTTP_GONE, HTTP_INTERNAL_ERROR, HTTP_LENGTH_REQUIRED, HTTP_MOVED_PERM, HTTP_MOVED_TEMP, HTTP_MULT_CHOICE, HTTP_NO_CONTENT, HTTP_NOT_ACCEPTABLE, HTTP_NOT_AUTHORITATIVE, HTTP_NOT_FOUND, HTTP_NOT_MODIFIED, HTTP_OK, HTTP_PARTIAL, HTTP_PAYMENT_REQUIRED, HTTP_PRECON_FAILED, HTTP_PROXY_AUTH, HTTP_REQ_TOO_LONG, HTTP_RESET, HTTP_SEE_OTHER, HTTP_SERVER_ERROR, HTTP_UNAUTHORIZED, HTTP_UNAVAILABLE, HTTP_UNSUPPORTED_TYPE, HTTP_USE_PROXY, HTTP_VERSION, method, responseCode, responseMessage
 
Fields inherited from class java.net.URLConnection
allowUserInteraction, connected, doInput, doOutput, ifModifiedSince, url, useCaches
 
Constructor Summary
HttpsURLConnection(URL url)
           
 
Method Summary
abstract  String getCipherSuite()
          Returns the cipher suite in use on this connection.
static HostnameVerifier getDefaultHostnameVerifier()
          Gets the default HostnameVerifier.
static SSLSocketFactory getDefaultSSLSocketFactory()
          Gets the default SSL socket factory.
 HostnameVerifier getHostnameVerifier()
          Gets the HostnameVerifier.
abstract  X509Certificate[] getServerCertificateChain()
          Returns the server's X.509 certificate chain, or null if the server did not authenticate.
 SSLSocketFactory getSSLSocketFactory()
          Gets the SSL socket factory.
static void setDefaultHostnameVerifier(HostnameVerifier v)
          Sets the default HostnameVerifier inherited when an instance of this class is created.
static void setDefaultSSLSocketFactory(SSLSocketFactory sf)
          Sets the default SSL socket factory inherited when an instance of this class is created.
 void setHostnameVerifier(HostnameVerifier v)
          Sets the HostnameVerifier.
 void setSSLSocketFactory(SSLSocketFactory sf)
          Sets the SSL socket factory.
 
Methods inherited from class java.net.HttpURLConnection
disconnect, getErrorStream, getFollowRedirects, getPermission, getRequestMethod, getResponseCode, getResponseMessage, setFollowRedirects, setRequestMethod, usingProxy
 
Methods inherited from class java.net.URLConnection
connect, getAllowUserInteraction, getContent, getContentEncoding, getContentLength, getContentType, getDate, getDefaultAllowUserInteraction, getDefaultRequestProperty, getDefaultUseCaches, getDoInput, getDoOutput, getExpiration, getFileNameMap, getHeaderField, getHeaderField, getHeaderFieldDate, getHeaderFieldInt, getHeaderFieldKey, getIfModifiedSince, getInputStream, getLastModified, getOutputStream, getRequestProperty, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setDoOutput, setFileNameMap, setIfModifiedSince, setRequestProperty, setUseCaches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hostnameVerifier

protected HostnameVerifier hostnameVerifier

sslSocketFactory

protected SSLSocketFactory sslSocketFactory
Constructor Detail

HttpsURLConnection

public HttpsURLConnection(URL url)
                   throws IOException
Method Detail

getCipherSuite

public abstract String getCipherSuite()
Returns the cipher suite in use on this connection.
Returns:
the cipher suite
Throws:
IllegalStateException - if this method is called before the connection has been established.

getServerCertificateChain

public abstract X509Certificate[] getServerCertificateChain()
Returns the server's X.509 certificate chain, or null if the server did not authenticate.
Returns:
the server certificate chain
Throws:
IllegalStateException - if this method is called before the connection has been established.

setDefaultHostnameVerifier

public static void setDefaultHostnameVerifier(HostnameVerifier v)
Sets the default HostnameVerifier inherited when an instance of this class is created.
Parameters:
v - the default host name verifier
Throws:
IllegalArgumentException - if the HostnameVerifier parameter is null.

getDefaultHostnameVerifier

public static HostnameVerifier getDefaultHostnameVerifier()
Gets the default HostnameVerifier.
Returns:
the default host name verifier

setHostnameVerifier

public void setHostnameVerifier(HostnameVerifier v)
Sets the HostnameVerifier.
Parameters:
v - the host name verifier
Throws:
IllegalArgumentException - if the HostnameVerifier parameter is null.

getHostnameVerifier

public HostnameVerifier getHostnameVerifier()
Gets the HostnameVerifier.
Returns:
the host name verifier

setDefaultSSLSocketFactory

public static void setDefaultSSLSocketFactory(SSLSocketFactory sf)
Sets the default SSL socket factory inherited when an instance of this class is created.
Parameters:
sf - the default SSL socket factory
Throws:
IllegalArgumentException - if the SSLSocketFactory parameter is null.

getDefaultSSLSocketFactory

public static SSLSocketFactory getDefaultSSLSocketFactory()
Gets the default SSL socket factory.
Returns:
the default SSL socket factory

setSSLSocketFactory

public void setSSLSocketFactory(SSLSocketFactory sf)
Sets the SSL socket factory.
Parameters:
sf - the SSL socket factory
Throws:
IllegalArgumentException - if the SSLSocketFactory parameter is null.

getSSLSocketFactory

public SSLSocketFactory getSSLSocketFactory()
Gets the SSL socket factory.
Returns:
the SSL socket factory