APIdia Launch Partner
Top Description Fields Constructors Methods
sun.net.www.protocol.https

pack-priv final Class HttpsClient

extends HttpClient
implements HandshakeCompletedListener
Class Inheritance
All Implemented Interfaces
javax.net.ssl.HandshakeCompletedListener, java.util.EventListener
Imports
java.io.IOException, .UnsupportedEncodingException, .PrintStream, .BufferedOutputStream, java.net.Socket, .SocketException, .URL, .UnknownHostException, .InetSocketAddress, .Proxy, java.security.cert.*, java.util.ArrayList, .List, .Objects, .StringTokenizer, javax.net.ssl.*, sun.net.util.IPAddressUtil, sun.net.www.http.HttpClient, sun.net.www.protocol.http.AuthCacheImpl, .HttpURLConnection, sun.security.util.HostnameChecker, sun.security.ssl.SSLSocketImpl, sun.util.logging.PlatformLogger

This class provides HTTPS client URL support, building on the standard "sun.net.www" HTTP protocol handler. HTTPS is the same protocol as HTTP, but differs in the transport layer which it uses:

System properties used include:

Authors
David Brownell, Bill Foote

Field Summary

Modifier and TypeField and Description
private static final String
private static final int
private HostnameVerifier
private SSLSession
private SSLSocketFactory
Inherited from sun.net.www.http.HttpClient:
authcachecachedHttpClienthostinCachekacportproxyDisabledreuseurlusingProxy

Constructor Summary

AccessConstructor and Description
pack-priv
HttpsClient(SSLSocketFactory sf, URL url, Proxy proxy, int connectTimeout)

Create an HTTPS client URL.

Method Summary

Modifier and TypeMethod and Description
public void
private void
public void
public void
closeServer()

Overrides sun.net.www.http.HttpClient.closeServer.

Close an open connection to the server.

protected Socket
createSocket()

Overrides sun.net.NetworkClient.createSocket.

The following method, createSocket, is defined in NetworkClient and overridden here so that the socket factory is used to create new sockets.

private String[]
protected int
getDefaultPort()

Overrides sun.net.www.http.HttpClient.getDefaultPort.

Returns the default HTTPS port (443)

private String[]
public String
getProxyHostUsed()

Overrides sun.net.www.http.HttpClient.getProxyHostUsed.

Returns: the proxy host being used for this client, or null if we're not going through a proxy

public int
getProxyPortUsed()

Overrides sun.net.www.http.HttpClient.getProxyPortUsed.

Returns: the proxy port being used for this client.

pack-priv SSLSession
getSSLSession()

Returns the SSLSession in use on this connection.

public void
handshakeCompleted(HandshakeCompletedEvent event)

Implements javax.net.ssl.HandshakeCompletedListener.handshakeCompleted.

This method implements the SSL HandshakeCompleted callback, remembering the resulting session so that it may be queried for the current cipher suite and peer certificates.

public boolean
pack-priv static HttpClient
New(SSLSocketFactory sf, URL url, HostnameVerifier hv, String proxyHost, int proxyPort, boolean useCache, int connectTimeout, HttpURLConnection httpuc)

pack-priv static HttpClient
New(SSLSocketFactory sf, URL url, HostnameVerifier hv, Proxy p, boolean useCache, int connectTimeout, HttpURLConnection httpuc)

protected void
private void
private void
Inherited from sun.net.www.http.HttpClient:
availablefinishedgetAuthCachegetHttpKeepAliveSetgetHttpProxygetInputStreamgetOutputStreamgetSpnegoCBTgetURLFilegetUsingProxyisCachedConnectionisInKeepAliveCacheisKeepingAlivelockNewNewNewNewNewNewnewHttpProxyopenServeropenServerparseHTTPresetPropertiessetCacheRequestsetDoNotRetrysetIgnoreContinuetoStringunlockwriteRequestswriteRequestswriteRequests

Field Detail

defaultHVCanonicalNameback to summary
private static final String defaultHVCanonicalName
httpsPortNumberback to summary
private static final int httpsPortNumber
hvback to summary
private HostnameVerifier hv
sessionback to summary
private SSLSession session
sslSocketFactoryback to summary
private SSLSocketFactory sslSocketFactory

Constructor Detail

HttpsClientback to summary
pack-priv HttpsClient(SSLSocketFactory sf, URL url, Proxy proxy, int connectTimeout) throws IOException

Create an HTTPS client URL. Traffic will be tunneled through the specified proxy server, with a connect timeout

Method Detail

afterConnectback to summary
public void afterConnect() throws IOException, UnknownHostException

Overrides sun.net.www.http.HttpClient.afterConnect.

Annotations
@Override
checkURLSpoofingback to summary
private void checkURLSpoofing(HostnameVerifier hostnameVerifier) throws IOException
closeIdleConnectionback to summary
public void closeIdleConnection()

Overrides sun.net.www.http.HttpClient.closeIdleConnection.

Annotations
@Override
closeServerback to summary
public void closeServer()

Overrides sun.net.www.http.HttpClient.closeServer.

Doc from sun.net.NetworkClient.closeServer.

Close an open connection to the server.

Annotations
@Override
createSocketback to summary
protected Socket createSocket() throws IOException

Overrides sun.net.NetworkClient.createSocket.

The following method, createSocket, is defined in NetworkClient and overridden here so that the socket factory is used to create new sockets.

Annotations
@Override
getCipherSuitesback to summary
private String[] getCipherSuites()
getDefaultPortback to summary
protected int getDefaultPort()

Overrides sun.net.www.http.HttpClient.getDefaultPort.

Returns the default HTTPS port (443)

Annotations
@Override
getProtocolsback to summary
private String[] getProtocols()
getProxyHostUsedback to summary
public String getProxyHostUsed()

Overrides sun.net.www.http.HttpClient.getProxyHostUsed.

Returns:String

the proxy host being used for this client, or null if we're not going through a proxy

Annotations
@Override
getProxyPortUsedback to summary
public int getProxyPortUsed()

Overrides sun.net.www.http.HttpClient.getProxyPortUsed.

Returns:int

the proxy port being used for this client. Meaningless if getProxyHostUsed() gives null.

Annotations
@Override
getSSLSessionback to summary
pack-priv SSLSession getSSLSession()

Returns the SSLSession in use on this connection.

handshakeCompletedback to summary
public void handshakeCompleted(HandshakeCompletedEvent event)

Implements javax.net.ssl.HandshakeCompletedListener.handshakeCompleted.

This method implements the SSL HandshakeCompleted callback, remembering the resulting session so that it may be queried for the current cipher suite and peer certificates. Servers sometimes re-initiate handshaking, so the session in use on a given connection may change. When sessions change, so may peer identities and cipher suites.

needsTunnelingback to summary
public boolean needsTunneling()

Overrides sun.net.www.http.HttpClient.needsTunneling.

Annotations
@Override
Newback to summary
pack-priv static HttpClient New(SSLSocketFactory sf, URL url, HostnameVerifier hv, String proxyHost, int proxyPort, boolean useCache, int connectTimeout, HttpURLConnection httpuc) throws IOException
Newback to summary
pack-priv static HttpClient New(SSLSocketFactory sf, URL url, HostnameVerifier hv, Proxy p, boolean useCache, int connectTimeout, HttpURLConnection httpuc) throws IOException
putInKeepAliveCacheback to summary
protected void putInKeepAliveCache()

Overrides sun.net.www.http.HttpClient.putInKeepAliveCache.

Annotations
@Override
setHostnameVerifierback to summary
private void setHostnameVerifier(HostnameVerifier hv)
setSSLSocketFactoryback to summary
private void setSSLSocketFactory(SSLSocketFactory sf)