Package net.targetr.wtm3.net.tls
Class SecureSuperSocketFactory
java.lang.Object
net.targetr.wtm3.net.tls.SecureSuperSocketFactory
Adds TLS to SuperSockets.
- Author:
- Dr Michael Gardiner
-
Method Summary
Modifier and TypeMethodDescriptioncreateSecureSocket(String sni, Socket plainSocket, InputStream consumed) Creates a new secure socket.static SecureSuperSocketFactoryget()Returns factory for creating secure sockets.Returns the DomainSetupManager used for storing domain configuration.voidsetDomainCertification(DomainCertification domainCertification) Sets domain certification for issuing certificates for a domain.
-
Method Details
-
get
Returns factory for creating secure sockets.- Returns:
- instance of the factory.
-
setDomainCertification
Sets domain certification for issuing certificates for a domain.- Parameters:
domainCertification- Certification for issuing new certificates.
-
getDomainSetupManager
Returns the DomainSetupManager used for storing domain configuration.- Returns:
- the DomainSetupManager instance
-
createSecureSocket
public SSLSocket createSecureSocket(String sni, Socket plainSocket, InputStream consumed) throws KeyManagementException, UnrecoverableKeyException, NoSuchAlgorithmException, CertificateException, KeyStoreException, IOException Creates a new secure socket.- Parameters:
sni- The server name indication for selecting the certificate.plainSocket- The unencrypted plain socket connection to the client.consumed- Previously read data to include in TLS setup.- Returns:
- A secure socket connection
- Throws:
KeyManagementException- if a key management error occursUnrecoverableKeyException- if a key cannot be recoveredNoSuchAlgorithmException- if a required algorithm is missingCertificateException- if a certificate error occursKeyStoreException- if a keystore error occursIOException- if an I/O error occurs
-