private static final class HttpsEndpoint.HttpsConnection extends SslConnection implements HttpClientSocketFactory
Utilities.SSLContextInfo| Modifier and Type | Field and Description |
|---|---|
private HttpsEndpoint.HttpsEndpointImpl |
endpoint
The associated endpoint.
|
private HttpClientConnection |
httpClient
The current HTTP client connection.
|
private long |
idleTime
The time this connection was found to be idle by the Reaper thread.
|
(package private) String |
proxyHost
The proxy host, or empty string if using a direct connection.
|
(package private) int |
proxyPort
The proxy port, ignored if using a direct connection.
|
callContext, closed, port, serverHost, socketFactory, sslSocket, sslSocketFactoryANY_KEY_ALGORITHM, clientLogger, DSA_KEY_ALGORITHM, getSubjectPermission, initLogger, INTEGRITY_PREFERRED, INTEGRITY_REQUIRED, RSA_KEY_ALGORITHM, serverLogger, UNKNOWN_PRINCIPAL| Constructor and Description |
|---|
HttpsConnection(HttpsEndpoint.HttpsEndpointImpl endpoint,
CallContext context,
String serverHost,
int port,
String proxyHost,
int proxyPort,
SocketFactory socketFactory)
Creates a connection.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) boolean |
checkIdle(long now)
Returns true if the recorded idle time is more than IDLE_TIMEOUT
milliseconds before now.
|
void |
close()
Closes this connection.
|
Socket |
createSocket(String host,
int port)
Creates a plain socket to use to talk to the proxy host, else
creates an SSL socket for a direct connection to the server.
|
Socket |
createTunnelSocket(Socket s)
Creates an SSL socket on top of the one the HTTP code used to
connect through the proxy.
|
(package private) void |
establishNewSocket()
Attempts to create a new socket for the specified call context and
cipher suites.
|
protected String |
getProxyHost()
Return the proxy host name.
|
(package private) OutboundRequest |
newRequest(CallContext callContext)
Uses the HTTPClientConnection to create an OutboundRequest object
with the specified call context, and sets the idle time to 0.
|
(package private) void |
noteIdle()
Adds this connection to the set of idle connections recorded for the
connection's endpoint.
|
private boolean |
ping()
Forward a ping request to the underlying HttpClientConnection.
|
private Socket |
setSSLSocket(SSLSocket newSocket)
Stores the new socket in the sslSocket field, does a handshake on
it, and returns it.
|
(package private) boolean |
usesHttpProxy()
Return true if this connection is using an HTTP proxy.
|
checkConnectPermission, createPlainSocket, establishCallContext, establishSuites, getChannel, getInputStream, getOutputStream, getUnfulfilledConstraints, populateContext, readResponseData, toString, useFor, writeRequestDatacheckValidity, contains, doesEncryption, doesServerAuthentication, equals, firstX509Cert, getCertFactory, getCipherAlgorithm, getClassName, getClientPrincipals, getClientPrincipals, getClientSSLContextInfo, getKeyAlgorithm, getKeyExchangeAlgorithm, getPermittedKeyAlgorithms, getServerPrincipals, getServerSSLContextInfo, getSupportedCipherSuites, hasStrongCipherAlgorithm, logThrow, maintainsIntegrity, permittedKeyAlgorithm, position, releaseClientSSLContextInfo, safeEquals, subjectString, toStringprivate final HttpsEndpoint.HttpsEndpointImpl endpoint
final String proxyHost
final int proxyPort
private HttpClientConnection httpClient
private long idleTime
HttpsConnection(HttpsEndpoint.HttpsEndpointImpl endpoint, CallContext context, String serverHost, int port, String proxyHost, int proxyPort, SocketFactory socketFactory) throws IOException
IOExceptionvoid establishNewSocket()
throws IOException
establishNewSocket in class SslConnectionSSLException - if the requested suites cannot be supportedIOException - if an I/O failure occursOutboundRequest newRequest(CallContext callContext) throws IOException
IOExceptionpublic void close()
throws IOException
Connectionclose in interface Connectionclose in class SslConnectionIOException - if an I/O exception occursboolean checkIdle(long now)
void noteIdle()
public Socket createSocket(String host, int port) throws IOException
createSocket in interface HttpClientSocketFactoryIOExceptionpublic Socket createTunnelSocket(Socket s) throws IOException
createTunnelSocket in interface HttpClientSocketFactoryIOExceptionprivate Socket setSSLSocket(SSLSocket newSocket) throws IOException
IOExceptionboolean usesHttpProxy()
private boolean ping()
throws IOException
IOExceptionprotected String getProxyHost()
getProxyHost in class SslConnectionCopyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.