Class GeneratingSSLContext
java.lang.Object
com.predic8.membrane.core.transport.ssl.SSLContext
com.predic8.membrane.core.transport.ssl.GeneratingSSLContext
- All Implemented Interfaces:
SSLProvider
-
Field Summary
Fields inherited from class com.predic8.membrane.core.transport.ssl.SSLContext
ciphers, endpointIdentificationAlgorithm, getApplicationProtocols, needClientAuth, protocols, setApplicationProtocols, wantClientAuth -
Constructor Summary
ConstructorsConstructorDescriptionGeneratingSSLContext(SSLParser sslParser, ResolverMap resourceResolver, String baseLocation) -
Method Summary
Modifier and TypeMethodDescriptioncreateServerSocket(int port, int backlog, InetAddress bindAddress) createSocket(String host, int port, int connectTimeout, String sniServerName, String[] applicationProtocols) createSocket(String host, int port, InetAddress addr, int localPort, int connectTimeout, String sniServerName, String[] applicationProtocols) createSocket(Socket s, String host, int port, int connectTimeout, String sniServerName, String[] applicationProtocols) getSSLContextForHostname(String hostname) longlongbooleanstatic X509Certificatesign(String subjectName, X509Certificate caPublic, PrivateKey caPrivate, PublicKey keyPublic) wrapAcceptedSocket(Socket socket) Methods inherited from class com.predic8.membrane.core.transport.ssl.SSLContext
applyCipherOrdering, applyCiphers, checkChainValidity, checkKeyMatchesCert, constructHostNamePattern, getApplicationProtocols, getMinimumValidity, getValidFrom, init, isUseAsDefault, showSSLExceptions, stop
-
Constructor Details
-
GeneratingSSLContext
-
-
Method Details
-
createServerSocket
public ServerSocket createServerSocket(int port, int backlog, InetAddress bindAddress) throws IOException - Throws:
IOException
-
wrapAcceptedSocket
- Throws:
IOException
-
getSSLContextForHostname
-
sign
public static X509Certificate sign(String subjectName, X509Certificate caPublic, PrivateKey caPrivate, PublicKey keyPublic) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchProviderException, SignatureException, IOException, org.bouncycastle.operator.OperatorCreationException, CertificateException - Throws:
InvalidKeyExceptionNoSuchAlgorithmExceptionNoSuchProviderExceptionSignatureExceptionIOExceptionorg.bouncycastle.operator.OperatorCreationExceptionCertificateException
-
createSocket
- Throws:
IOException
-
createSocket
public Socket createSocket(Socket s, String host, int port, int connectTimeout, @Nullable String sniServerName, @Nullable String[] applicationProtocols) throws IOException host- relevant to verify the server cert onlyport- relevant to verify the server cert only- Throws:
IOException
-
createSocket
public Socket createSocket(String host, int port, int connectTimeout, @Nullable String sniServerName, @Nullable String[] applicationProtocols) throws IOException - Throws:
IOException
-
createSocket
public Socket createSocket(String host, int port, InetAddress addr, int localPort, int connectTimeout, @Nullable String sniServerName, @Nullable String[] applicationProtocols) throws IOException - Throws:
IOException
-
wrap
- Overrides:
wrapin classSSLContext- Throws:
IOException
-
getPrometheusContextTypeName
- Specified by:
getPrometheusContextTypeNamein classSSLContext
-
hasKeyAndCertificate
public boolean hasKeyAndCertificate()- Specified by:
hasKeyAndCertificatein classSSLContext- Returns:
- whether this context has a working certificate and key
-
getValidFrom
public long getValidFrom()- Specified by:
getValidFromin classSSLContext
-
getValidUntil
public long getValidUntil()- Specified by:
getValidUntilin classSSLContext
-