iaik.protocol.https
Class HttpsURLConnection

java.lang.Object
  extended by java.net.URLConnection
      extended by java.net.HttpURLConnection
          extended by org.w3c.www.protocol.http.HttpURLConnection
              extended by 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

Field Summary
 
Fields inherited from class org.w3c.www.protocol.http.HttpURLConnection
output, reply, request, sslContext, streamingSrv
 
Fields inherited from class java.net.HttpURLConnection
chunkLength, fixedContentLength, 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_IMPLEMENTED, 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, instanceFollowRedirects, 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.
HttpsURLConnection(java.net.URL u, java.net.Proxy p)
          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
addRequestProperty, checkReply, checkRequest, connect, connect0, debug, disconnect, error, getConnectTimeout, getContentLength, getContentType, getDate, getDefaultRequestProperty, getErrorStream, getExpiration, getHeaderField, getHeaderField, getHeaderFieldKey, getHeaderFields, getInputStream, getInstanceFollowRedirects, getLastModified, getOutputStream, getReadTimeout, getRequestProperties, getRequestProperty, getResponseCode, getResponseMessage, setChunkedStreamingMode, setConnectTimeout, setDoOutput, setFixedLengthStreamingMode, setFixedLengthStreamingMode, setGlobalRequestProperty, setInputStream, setInstanceFollowRedirects, setReadTimeout, setRequestMethod, setRequestProperty, usingProxy
 
Methods inherited from class java.net.HttpURLConnection
getFollowRedirects, getHeaderFieldDate, getPermission, getRequestMethod, setFollowRedirects
 
Methods inherited from class java.net.URLConnection
getAllowUserInteraction, getContent, getContent, getContentEncoding, getDefaultAllowUserInteraction, getDefaultUseCaches, getDoInput, getDoOutput, getFileNameMap, 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(URL) 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.

Parameters:
u - the URL to connect to
Throws:
java.io.IOException

HttpsURLConnection

public HttpsURLConnection(java.net.URL u,
                          java.net.Proxy p)
                   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(URL, Proxy) on a HTTPS URL with the protocol handler installed.

Parameters:
u - the URL to connect to
p - the Proxy through which to connect
Throws:
java.io.IOException
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.

Overrides:
setSSLContext in class org.w3c.www.protocol.http.HttpURLConnection

getSSLContext

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

Overrides:
getSSLContext in class org.w3c.www.protocol.http.HttpURLConnection

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.

Overrides:
getSSLSocket in class org.w3c.www.protocol.http.HttpURLConnection
Throws:
java.io.IOException

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

iSaSiLk 6.0, (c) 2002 IAIK, (c) 2003 - 2015 SIC