iaik.protocol.https
Class HttpsURLConnection

java.lang.Object
  |
  +--java.net.URLConnection
        |
        +--java.net.HttpURLConnection
              |
              +--org.w3c.www.protocol.http.HttpURLConnection
                    |
                    +--iaik.protocol.https.HttpsURLConnection

public class HttpsURLConnection
extends org.w3c.www.protocol.http.HttpURLConnection

The class HttpsURLConnection provides support for HTTPS URLs. HTTPS is simply HTTP over SSL/TLS instead of over plain TCP. This code makes use of a IAIK customized version of the W3C HTTP implementation provided as the JAR file w3c_http.jar.

This class provides all the standard features of java.net.HttpURLConnection plus the SSL specific methods defined below.

Note that there is a separate document describing the use of HTTPS with iSaSiLk in more detail, it is called https.html and provided in your iSaSiLk installation directory.

See Also:
HttpsURLStreamHandlerFactory, Handler

Fields inherited from class org.w3c.www.protocol.http.HttpURLConnection
output, reply, request, sslContext
 
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(java.net.URL u)
          Constructor for a HttpsURLConnection.
 
Method Summary
static SSLContext getDefaultSSLContext()
          Get the current default SSLContext.
 SSLContext getSSLContext()
          Get the current SSLContext for this HTTPS URLConnection.
 SSLSocket getSSLSocket()
          Get the SSLSocket this URLConnection is communicating over.
static void setDefaultSSLContext(SSLContext context)
          Set the default SSLContext for all HTTPS URLConnections.
 void setSSLContext(SSLContext context)
          Set the SSLContext to be used for this HTTPS URLConnection.
 
Methods inherited from class org.w3c.www.protocol.http.HttpURLConnection
checkReply, checkRequest, connect, debug, disconnect, error, getContentLength, getContentType, getDate, getDefaultRequestProperty, getExpiration, getHeaderField, getHeaderField, getHeaderFieldKey, getInputStream, getLastModified, getOutputStream, getRequestProperty, getResponseCode, setDoOutput, setGlobalRequestProperty, setRequestProperty, usingProxy
 
Methods inherited from class java.net.HttpURLConnection
getErrorStream, getFollowRedirects, getPermission, getRequestMethod, getResponseMessage, setFollowRedirects, setRequestMethod
 
Methods inherited from class java.net.URLConnection
getAllowUserInteraction, getContent, getContentEncoding, getDefaultAllowUserInteraction, getDefaultUseCaches, getDoInput, getDoOutput, getFileNameMap, getHeaderFieldDate, getHeaderFieldInt, getIfModifiedSince, getURL, getUseCaches, guessContentTypeFromName, guessContentTypeFromStream, setAllowUserInteraction, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultRequestProperty, setDefaultUseCaches, setDoInput, setFileNameMap, setIfModifiedSince, setUseCaches, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HttpsURLConnection

public HttpsURLConnection(java.net.URL u)
                   throws java.io.IOException
Constructor for a HttpsURLConnection. This constructor should normally not be used directly, it will automatically be called if you call openConnection() on a HTTPS URL with the protocol handler installed.

In case you are unable to properly register the HTTPS handler you can use this constructor directly, but first see https.html for details.

Method Detail

setDefaultSSLContext

public static void setDefaultSSLContext(SSLContext context)
Set the default SSLContext for all HTTPS URLConnections. The default is used if no SSLContext has been set explicitly for a particular HttpsURLConnection. Initially, the default context is a SSLClientContext as returned by its default constructor without any additional settings.

getDefaultSSLContext

public static SSLContext getDefaultSSLContext()
Get the current default SSLContext.

setSSLContext

public void setSSLContext(SSLContext context)
Set the SSLContext to be used for this HTTPS URLConnection. If this method is not called the default SSLContext will be used.

getSSLContext

public SSLContext getSSLContext()
Get the current SSLContext for this HTTPS URLConnection.

getSSLSocket

public SSLSocket getSSLSocket()
                       throws java.io.IOException
Get the SSLSocket this URLConnection is communicating over. If this method is called when the connection is not yet established it throws an IOException. NOTE that the socket should only be used to query SSL status parameters and not for anything else.