public abstract class

AbstractDelegateHttpsURLConnection

extends HttpURLConnection
java.lang.Object
   ↳ java.net.URLConnection
     ↳ java.net.HttpURLConnection
       ↳ sun.net.www.protocol.http.HttpURLConnection
         ↳ sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection
Known Direct Subclasses

Class Overview

HTTPS URL connection support. We need this delegate because HttpsURLConnection is a subclass of java.net.HttpURLConnection. We will avoid copying over the code from sun.net.www.protocol.http.HttpURLConnection by having this class

Summary

[Expand]
Inherited Constants
From class java.net.HttpURLConnection
[Expand]
Inherited Fields
From class sun.net.www.protocol.http.HttpURLConnection
From class java.net.HttpURLConnection
From class java.net.URLConnection
Protected Constructors
AbstractDelegateHttpsURLConnection(URL url, Handler handler)
AbstractDelegateHttpsURLConnection(URL url, Proxy p, Handler handler)
Public Methods
void connect()
Implements the HTTP protocol handler's "connect" method, establishing an SSL connection to the server as necessary.
String getCipherSuite()
Returns the cipher suite in use on this connection.
Certificate[] getLocalCertificates()
Returns the certificate chain the client sent to the server, or null if the client did not authenticate.
X509Certificate[] getServerCertificateChain()
Returns the server's X.509 certificate chain, or null if the server did not authenticate.
Certificate[] getServerCertificates()
Returns the server's certificate chain, or throws SSLPeerUnverified Exception if the server did not authenticate.
boolean isConnected()
Used by subclass to access "connected" variable.
void setConnected(boolean conn)
Used by subclass to access "connected" variable.
void setNewClient(URL url)
Create a new HttpClient object, bypassing the cache of HTTP client objects/connections.
void setNewClient(URL url, boolean useCache)
Obtain a HttpClient object.
void setProxiedClient(URL url, String proxyHost, int proxyPort)
Create a new HttpClient object, set up so that it uses per-instance proxying to the given HTTP proxy.
void setProxiedClient(URL url, String proxyHost, int proxyPort, boolean useCache)
Obtain a HttpClient object, set up so that it uses per-instance proxying to the given HTTP proxy.
Protected Methods
abstract HostnameVerifier getHostnameVerifier()
HttpClient getNewHttpClient(URL url, Proxy p, int connectTimeout)
HttpClient getNewHttpClient(URL url, Proxy p, int connectTimeout, boolean useCache)
abstract SSLSocketFactory getSSLSocketFactory()
void proxiedConnect(URL url, String proxyHost, int proxyPort, boolean useCache)
[Expand]
Inherited Methods
From class sun.net.www.protocol.http.HttpURLConnection
From class java.net.HttpURLConnection
From class java.net.URLConnection
From class java.lang.Object

Protected Constructors

protected AbstractDelegateHttpsURLConnection (URL url, Handler handler)

Throws
IOException

protected AbstractDelegateHttpsURLConnection (URL url, Proxy p, Handler handler)

Throws
IOException

Public Methods

public void connect ()

Implements the HTTP protocol handler's "connect" method, establishing an SSL connection to the server as necessary.

Throws
IOException

public String getCipherSuite ()

Returns the cipher suite in use on this connection.

public Certificate[] getLocalCertificates ()

Returns the certificate chain the client sent to the server, or null if the client did not authenticate.

public X509Certificate[] getServerCertificateChain ()

Returns the server's X.509 certificate chain, or null if the server did not authenticate.

public Certificate[] getServerCertificates ()

Returns the server's certificate chain, or throws SSLPeerUnverified Exception if the server did not authenticate.

public boolean isConnected ()

Used by subclass to access "connected" variable.

public void setConnected (boolean conn)

Used by subclass to access "connected" variable.

public void setNewClient (URL url)

Create a new HttpClient object, bypassing the cache of HTTP client objects/connections. Note: this method is changed from protected to public because the com.sun.ssl.internal.www.protocol.https handler reuses this class for its actual implemantation

Parameters
url the URL being accessed
Throws
IOException

public void setNewClient (URL url, boolean useCache)

Obtain a HttpClient object. Use the cached copy if specified. Note: this method is changed from protected to public because the com.sun.ssl.internal.www.protocol.https handler reuses this class for its actual implemantation

Parameters
url the URL being accessed
useCache whether the cached connection should be used if present
Throws
IOException

public void setProxiedClient (URL url, String proxyHost, int proxyPort)

Create a new HttpClient object, set up so that it uses per-instance proxying to the given HTTP proxy. This bypasses the cache of HTTP client objects/connections. Note: this method is changed from protected to public because the com.sun.ssl.internal.www.protocol.https handler reuses this class for its actual implemantation

Parameters
url the URL being accessed
proxyHost the proxy host to use
proxyPort the proxy port to use
Throws
IOException

public void setProxiedClient (URL url, String proxyHost, int proxyPort, boolean useCache)

Obtain a HttpClient object, set up so that it uses per-instance proxying to the given HTTP proxy. Use the cached copy of HTTP client objects/connections if specified. Note: this method is changed from protected to public because the com.sun.ssl.internal.www.protocol.https handler reuses this class for its actual implemantation

Parameters
url the URL being accessed
proxyHost the proxy host to use
proxyPort the proxy port to use
useCache whether the cached connection should be used if present
Throws
IOException

Protected Methods

protected abstract HostnameVerifier getHostnameVerifier ()

protected HttpClient getNewHttpClient (URL url, Proxy p, int connectTimeout)

Throws
IOException

protected HttpClient getNewHttpClient (URL url, Proxy p, int connectTimeout, boolean useCache)

Throws
IOException

protected abstract SSLSocketFactory getSSLSocketFactory ()

protected void proxiedConnect (URL url, String proxyHost, int proxyPort, boolean useCache)

Throws
IOException