public abstract class HttpsURLConnection extends HttpURLConnection
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.
chunkLength, fixedContentLength, fixedContentLengthLong, 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_UNAUTHORIZED, HTTP_UNAVAILABLE, HTTP_UNSUPPORTED_TYPE, HTTP_USE_PROXY, HTTP_VERSION, instanceFollowRedirects, method, responseCode, responseMessage
allowUserInteraction, connected, doInput, doOutput, url, useCaches
Modifier | Constructor and Description |
---|---|
protected |
HttpsURLConnection(URL url)
Creates an
HttpsURLConnection using the
URL specified. |
Modifier and Type | Method and Description |
---|---|
static SSLSocketFactory |
getDefaultSSLSocketFactory()
Gets the default static
SSLSocketFactory that is
inherited by new instances of this class. |
SSLSocketFactory |
getSSLSocketFactory()
Gets the SSL socket factory to be used when creating sockets
for secure https URL connections.
|
static void |
setDefaultSSLSocketFactory(SSLSocketFactory sf)
Sets the default
SSLSocketFactory inherited by new
instances of this class. |
void |
setSSLSocketFactory(SSLSocketFactory sf)
Sets the
SSLSocketFactory to be used when this instance
creates sockets for secure https URL connections. |
disconnect, getErrorStream, getFollowRedirects, getHeaderField, getHeaderFieldKey, getInstanceFollowRedirects, getPermission, getRequestMethod, getResponseCode, getResponseMessage, setChunkedStreamingMode, setFixedLengthStreamingMode, setFixedLengthStreamingMode, setFollowRedirects, setInstanceFollowRedirects, setRequestMethod, usingProxy
addRequestProperty, connect, getAllowUserInteraction, getConnectTimeout, getContent, getContent, getContentEncoding, getContentLength, getContentLengthLong, getContentType, getDefaultAllowUserInteraction, getDefaultUseCaches, getDoInput, getDoOutput, getHeaderField, getHeaderFieldInt, getHeaderFieldLong, getHeaderFields, getInputStream, getOutputStream, getReadTimeout, getRequestProperties, getRequestProperty, getURL, getUseCaches, setAllowUserInteraction, setConnectTimeout, setContentHandlerFactory, setDefaultAllowUserInteraction, setDefaultUseCaches, setDoInput, setDoOutput, setReadTimeout, setRequestProperty, setUseCaches, toString
protected HttpsURLConnection(URL url)
HttpsURLConnection
using the
URL specified.url
- the URLpublic static SSLSocketFactory getDefaultSSLSocketFactory()
SSLSocketFactory
that is
inherited by new instances of this class.
The socket factories are used when creating sockets for secure https URL connections.
SSLSocketFactory
setDefaultSSLSocketFactory(SSLSocketFactory)
public SSLSocketFactory getSSLSocketFactory()
SSLSocketFactory
setSSLSocketFactory(SSLSocketFactory)
public static void setDefaultSSLSocketFactory(SSLSocketFactory sf)
SSLSocketFactory
inherited by new
instances of this class.
The socket factories are used when creating sockets for secure https URL connections.
sf
- the default SSL socket factoryIllegalArgumentException
- if the SSLSocketFactory
parameter is null.SecurityException
- if a security manager exists and its
checkSetFactory
method does not allow
a socket factory to be specified.getDefaultSSLSocketFactory()
public void setSSLSocketFactory(SSLSocketFactory sf)
SSLSocketFactory
to be used when this instance
creates sockets for secure https URL connections.
New instances of this class inherit the default static
SSLSocketFactory
set by
setDefaultSSLSocketFactory
. Calls to this method replace
this object's SSLSocketFactory
.
sf
- the SSL socket factoryIllegalArgumentException
- if the SSLSocketFactory
parameter is null.SecurityException
- if a security manager exists and its
checkSetFactory
method does not allow
a socket factory to be specified.getSSLSocketFactory()