com.microsoft.tfs.core.config.httpclient.internal
Class DefaultSSLProtocolSocketFactory
java.lang.Object
com.microsoft.tfs.core.config.httpclient.internal.DefaultSSLProtocolSocketFactory
- All Implemented Interfaces:
- ProtocolSocketFactory, SecureProtocolSocketFactory
public class DefaultSSLProtocolSocketFactory
- extends java.lang.Object
- implements SecureProtocolSocketFactory
An SSL socket factory for HTTPClient that tweaks certificate validation,
either providing the ability to accept self-signed certificates, or one that
includes additional certificates (notably newer well-trusted certificates
like the Microsoft Internet Authority certificate, vital for connecting to
Azure-hosted TFS servers on platforms that lack the updated Microsoft
Internet Authority cert.)
Method Summary |
java.net.Socket |
createSocket(java.net.Socket socket,
java.lang.String host,
int port,
HttpConnectionParams params,
boolean autoClose)
Returns a socket connected to the given host that is layered over an
existing socket. |
java.net.Socket |
createSocket(java.lang.String host,
int port,
java.net.InetAddress localAddress,
int localPort,
HttpConnectionParams params)
Gets a new socket connection to the given host. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ACCEPT_UNTRUSTED_CERTIFICATES_PARAMETER
public static final java.lang.String ACCEPT_UNTRUSTED_CERTIFICATES_PARAMETER
- Constant Field Value:
"DefaultSSLProtocolSocketFactory.acceptUntrustedCertificates"
- See Also:
- Constant Field Values
DISABLE_PROPERTY_NAME
public static final java.lang.String DISABLE_PROPERTY_NAME
- Constant Field Value:
"com.microsoft.tfs.core.config.httpclient.sslsocketfactory.disable"
- See Also:
- Constant Field Values
DefaultSSLProtocolSocketFactory
public DefaultSSLProtocolSocketFactory()
createSocket
public java.net.Socket createSocket(java.lang.String host,
int port,
java.net.InetAddress localAddress,
int localPort,
HttpConnectionParams params)
throws java.io.IOException,
java.net.UnknownHostException,
ConnectTimeoutException
- Gets a new socket connection to the given host.
- Specified by:
createSocket
in interface ProtocolSocketFactory
- Parameters:
host
- the host name/IPport
- the port on the hostlocalAddress
- the local host name/IP to bind the socket tolocalPort
- the port on the local machineparams
- Http connection parameters
- Returns:
- Socket a new socket
- Throws:
java.io.IOException
- if an I/O error occurs while creating the socket
java.net.UnknownHostException
- if the IP address of the host cannot be determined
ConnectTimeoutException
- if socket cannot be connected within the given time limit
createSocket
public java.net.Socket createSocket(java.net.Socket socket,
java.lang.String host,
int port,
HttpConnectionParams params,
boolean autoClose)
throws java.io.IOException,
java.net.UnknownHostException
- Returns a socket connected to the given host that is layered over an
existing socket. Used primarily for creating secure sockets through
proxies.
- Specified by:
createSocket
in interface SecureProtocolSocketFactory
- Parameters:
socket
- the existing sockethost
- the host name/IPport
- the port on the hostautoClose
- a flag for closing the underling socket when the created socket is
closed
- Returns:
- Socket a new socket
- Throws:
java.io.IOException
- if an I/O error occurs while creating the socket
java.net.UnknownHostException
- if the IP address of the host cannot be determined
© 2015 Microsoft. All rights reserved.