com.caucho.vfs
Class OpenSSLFactory

java.lang.Object
  extended by com.caucho.vfs.QServerSocket
      extended by com.caucho.vfs.OpenSSLFactory
All Implemented Interfaces:
SSLFactory

public class OpenSSLFactory
extends QServerSocket
implements SSLFactory

Abstract socket to handle both normal sockets and bin/resin sockets.


Constructor Summary
OpenSSLFactory()
          Creates a ServerSocket factory without initializing it.
 
Method Summary
 boolean accept(QSocket socket)
           
 QServerSocket bind(QServerSocket ss)
          Creates the server socket.
 void close()
           
 QServerSocket create(java.net.InetAddress addr, int port)
          Creates the server socket.
 QSocket createSocket()
           
 java.lang.String getCACertificateFile()
          Returns the caCertificateFile.
 java.lang.String getCACertificatePath()
          Returns the caCertificatePath.
 java.lang.String getCARevocationFile()
          Returns the caRevocationFile.
 java.lang.String getCARevocationPath()
          Returns the caRevocationPath.
 java.lang.String getCertificateChainFile()
          Returns the certificateChainFile
 java.lang.String getCertificateFile()
          Returns the certificate file.
 java.lang.String getCertificateKeyFile()
          Returns the key file.
 java.lang.String getCipherSuite()
          Returns the cipher suite
 java.lang.String getCryptoDevice()
          Returns the crypto-device
 java.net.InetAddress getLocalAddress()
           
 int getLocalPort()
           
 java.lang.String getPassword()
          Returns the key file.
 boolean getUncleanShutdown()
          Returns the unclean shutdown
 java.lang.String getVerifyClient()
          Returns the verify client
 void init()
          Initialize
 void initConfig()
           
 boolean isTcpNoDelay()
           
 void listen(int backlog)
          Sets the socket's listen backlog.
 void setCACertificateFile(Path caCertificateFile)
          Sets the caCertificateFile.
 void setCACertificatePath(Path caCertificatePath)
          Sets the caCertificatePath.
 void setCARevocationFile(Path caRevocationFile)
          Sets the caRevocationFile.
 void setCARevocationPath(Path caRevocationPath)
          Sets the caRevocationPath.
 void setCertificateChainFile(Path certificateChainFile)
          Sets the certificateChainFile.
 void setCertificateFile(Path certificateFile)
          Sets the certificate file.
 void setCertificateKeyFile(Path keyFile)
          Sets the key file.
 void setCipherSuite(java.lang.String cipherSuite)
          Sets the cipher-suite
 void setConnectionSocketTimeout(int ms)
          Sets the socket timeout for connections.
 void setCryptoDevice(java.lang.String cryptoDevice)
          Sets the crypto-device
 void setPassword(java.lang.String password)
          Sets the password.
 void setProtocol(java.lang.String protocol)
          Sets the protocol: +SSLv3
 void setSessionCache(boolean enable)
          Enable the session cache
 void setSessionCacheTimeout(Period period)
          Sets the session cache timeout
 void setTcpNoDelay(boolean delay)
           
 void setUncleanShutdown(boolean uncleanShutdown)
          Sets the unclean-shutdown
 void setVerifyClient(java.lang.String verifyClient)
          Sets the verifyClient.
 void setVerifyDepth(int verifyDepth)
          Sets the verify depth
 
Methods inherited from class com.caucho.vfs.QServerSocket
getSelector, getSystemFD, isClosed, isJni, isTcpKeepalive, setSaveOnExec, setTcpKeepalive
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenSSLFactory

public OpenSSLFactory()
Creates a ServerSocket factory without initializing it.

Method Detail

setCertificateFile

public void setCertificateFile(Path certificateFile)
Sets the certificate file.


getCertificateFile

public java.lang.String getCertificateFile()
Returns the certificate file.


setCertificateKeyFile

public void setCertificateKeyFile(Path keyFile)
Sets the key file.


getCertificateKeyFile

public java.lang.String getCertificateKeyFile()
Returns the key file.


setCertificateChainFile

public void setCertificateChainFile(Path certificateChainFile)
Sets the certificateChainFile.


getCertificateChainFile

public java.lang.String getCertificateChainFile()
Returns the certificateChainFile


setCACertificatePath

public void setCACertificatePath(Path caCertificatePath)
Sets the caCertificatePath.


getCACertificatePath

public java.lang.String getCACertificatePath()
Returns the caCertificatePath.


setCACertificateFile

public void setCACertificateFile(Path caCertificateFile)
Sets the caCertificateFile.


getCACertificateFile

public java.lang.String getCACertificateFile()
Returns the caCertificateFile.


setCARevocationPath

public void setCARevocationPath(Path caRevocationPath)
Sets the caRevocationPath.


getCARevocationPath

public java.lang.String getCARevocationPath()
Returns the caRevocationPath.


setCARevocationFile

public void setCARevocationFile(Path caRevocationFile)
Sets the caRevocationFile.


getCARevocationFile

public java.lang.String getCARevocationFile()
Returns the caRevocationFile.


setCipherSuite

public void setCipherSuite(java.lang.String cipherSuite)
Sets the cipher-suite


getCipherSuite

public java.lang.String getCipherSuite()
Returns the cipher suite


setCryptoDevice

public void setCryptoDevice(java.lang.String cryptoDevice)
Sets the crypto-device


getCryptoDevice

public java.lang.String getCryptoDevice()
Returns the crypto-device


setPassword

public void setPassword(java.lang.String password)
Sets the password.


getPassword

public java.lang.String getPassword()
Returns the key file.


setVerifyClient

public void setVerifyClient(java.lang.String verifyClient)
                     throws ConfigException
Sets the verifyClient.

Throws:
ConfigException

getVerifyClient

public java.lang.String getVerifyClient()
Returns the verify client


setVerifyDepth

public void setVerifyDepth(int verifyDepth)
Sets the verify depth


setUncleanShutdown

public void setUncleanShutdown(boolean uncleanShutdown)
Sets the unclean-shutdown


getUncleanShutdown

public boolean getUncleanShutdown()
Returns the unclean shutdown


setSessionCache

public void setSessionCache(boolean enable)
Enable the session cache


setSessionCacheTimeout

public void setSessionCacheTimeout(Period period)
Sets the session cache timeout


setProtocol

public void setProtocol(java.lang.String protocol)
                 throws ConfigException
Sets the protocol: +SSLv3

Throws:
ConfigException

init

@PostConstruct
public void init()
          throws ConfigException
Initialize

Throws:
ConfigException

create

public QServerSocket create(java.net.InetAddress addr,
                            int port)
                     throws ConfigException,
                            java.io.IOException
Creates the server socket.

Specified by:
create in interface SSLFactory
Throws:
ConfigException
java.io.IOException

bind

public QServerSocket bind(QServerSocket ss)
                   throws ConfigException,
                          java.io.IOException
Creates the server socket.

Specified by:
bind in interface SSLFactory
Throws:
ConfigException
java.io.IOException

setTcpNoDelay

public void setTcpNoDelay(boolean delay)
Overrides:
setTcpNoDelay in class QServerSocket

isTcpNoDelay

public boolean isTcpNoDelay()
Overrides:
isTcpNoDelay in class QServerSocket

setConnectionSocketTimeout

public void setConnectionSocketTimeout(int ms)
Sets the socket timeout for connections.

Specified by:
setConnectionSocketTimeout in class QServerSocket

listen

public void listen(int backlog)
Sets the socket's listen backlog.

Overrides:
listen in class QServerSocket

accept

public boolean accept(QSocket socket)
               throws java.io.IOException
Specified by:
accept in class QServerSocket
Throws:
java.io.IOException

createSocket

public QSocket createSocket()
                     throws java.io.IOException
Specified by:
createSocket in class QServerSocket
Throws:
java.io.IOException

getLocalAddress

public java.net.InetAddress getLocalAddress()
Specified by:
getLocalAddress in class QServerSocket

getLocalPort

public int getLocalPort()
Specified by:
getLocalPort in class QServerSocket

close

public void close()
           throws java.io.IOException
Specified by:
close in class QServerSocket
Throws:
java.io.IOException

initConfig

public void initConfig()
                throws ConfigException
Throws:
ConfigException