edu.internet2.middleware.grouperClient.ssl
Class EasySslSocketFactory

java.lang.Object
  extended by edu.internet2.middleware.grouperClient.ssl.EasySslSocketFactory
All Implemented Interfaces:
ProtocolSocketFactory, SecureProtocolSocketFactory

public class EasySslSocketFactory
extends Object
implements SecureProtocolSocketFactory

Apache code for SSL that doesnt fail with self-signed certs

Author:
mchyzer

Nested Class Summary
static class EasySslSocketFactory.EasyX509TrustManager
          jakarta code for SSL that doesnt fail with self-signed certs
 
Constructor Summary
EasySslSocketFactory()
           
 
Method Summary
 Socket createSocket(Socket socket, String host, int port, boolean autoClose)
          Returns a socket connected to the given host that is layered over an existing socket.
 Socket createSocket(String host, int port)
          Gets a new socket connection to the given host.
 Socket createSocket(String host, int port, InetAddress clientHost, int clientPort)
          Gets a new socket connection to the given host.
 Socket createSocket(String host, int port, InetAddress clientHost, int clientPort, HttpConnectionParams arg4)
          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
 

Constructor Detail

EasySslSocketFactory

public EasySslSocketFactory()
Method Detail

createSocket

public Socket createSocket(String host,
                           int port,
                           InetAddress clientHost,
                           int clientPort)
                    throws IOException,
                           UnknownHostException
Description copied from interface: ProtocolSocketFactory
Gets a new socket connection to the given host.

Specified by:
createSocket in interface ProtocolSocketFactory
Parameters:
host - the host name/IP
port - the port on the host
clientHost - the local host name/IP to bind the socket to
clientPort - the port on the local machine
Returns:
Socket a new socket
Throws:
IOException - if an I/O error occurs while creating the socket
UnknownHostException - if the IP address of the host cannot be determined
See Also:
ProtocolSocketFactory.createSocket(java.lang.String,int,java.net.InetAddress,int)

createSocket

public Socket createSocket(String host,
                           int port)
                    throws IOException,
                           UnknownHostException
Description copied from interface: ProtocolSocketFactory
Gets a new socket connection to the given host.

Specified by:
createSocket in interface ProtocolSocketFactory
Parameters:
host - the host name/IP
port - the port on the host
Returns:
Socket a new socket
Throws:
IOException - if an I/O error occurs while creating the socket
UnknownHostException - if the IP address of the host cannot be determined
See Also:
ProtocolSocketFactory.createSocket(java.lang.String,int)

createSocket

public Socket createSocket(Socket socket,
                           String host,
                           int port,
                           boolean autoClose)
                    throws IOException,
                           UnknownHostException
Description copied from interface: SecureProtocolSocketFactory
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 socket
host - the host name/IP
port - the port on the host
autoClose - a flag for closing the underling socket when the created socket is closed
Returns:
Socket a new socket
Throws:
IOException - if an I/O error occurs while creating the socket
UnknownHostException - if the IP address of the host cannot be determined
See Also:
SecureProtocolSocketFactory.createSocket(java.net.Socket,java.lang.String,int,boolean)

createSocket

public Socket createSocket(String host,
                           int port,
                           InetAddress clientHost,
                           int clientPort,
                           HttpConnectionParams arg4)
                    throws IOException,
                           UnknownHostException,
                           ConnectTimeoutException
Description copied from interface: ProtocolSocketFactory
Gets a new socket connection to the given host.

Specified by:
createSocket in interface ProtocolSocketFactory
Parameters:
host - the host name/IP
port - the port on the host
clientHost - the local host name/IP to bind the socket to
clientPort - the port on the local machine
arg4 - Http connection parameters
Returns:
Socket a new socket
Throws:
IOException - if an I/O error occurs while creating the socket
UnknownHostException - if the IP address of the host cannot be determined
ConnectTimeoutException - if socket cannot be connected within the given time limit
See Also:
org.apache.commons.httpclient.protocol.ProtocolSocketFactory#createSocket(java.lang.String, int, java.net.InetAddress, int, org.apache.commons.httpclient.params.HttpConnectionParams)


Copyright © 2010 Internet2. All Rights Reserved.