Package net.officefloor.server.ssl
Class OfficeFloorDefaultSslContextSource
- java.lang.Object
-
- net.officefloor.server.ssl.OfficeFloorDefaultSslContextSource
-
- All Implemented Interfaces:
SslContextSource
public class OfficeFloorDefaultSslContextSource extends java.lang.Object implements SslContextSource
OfficeFloor default
SslContextSource
.This should NOT be used within production. The purpose is to allow testing of HTTPS communication without needing manual
KeyStore
setup.- Author:
- Daniel Sagenschneider
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROPERTY_SSL_PROTOCOL
Property to specify the SSL protocol to use.
-
Constructor Summary
Constructors Constructor Description OfficeFloorDefaultSslContextSource()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.net.ssl.SSLContext
createClientSslContext(java.lang.String sslProtocol)
Creates theOfficeFloor
default clientSSLContext
.static javax.net.ssl.SSLContext
createServerSslContext(java.lang.String sslProtocol)
Creates theOfficeFloor
default serverSSLContext
.javax.net.ssl.SSLContext
createSslContext(SourceContext context)
Creates a newSSLContext
.
-
-
-
Field Detail
-
PROPERTY_SSL_PROTOCOL
public static final java.lang.String PROPERTY_SSL_PROTOCOL
Property to specify the SSL protocol to use.- See Also:
- Constant Field Values
-
-
Method Detail
-
createServerSslContext
public static javax.net.ssl.SSLContext createServerSslContext(java.lang.String sslProtocol) throws java.lang.Exception
Creates theOfficeFloor
default serverSSLContext
.- Parameters:
sslProtocol
- SSL protocol. May benull
.- Returns:
OfficeFloor
default serverSSLContext
.- Throws:
java.lang.Exception
- If fails to create theSSLContext
.
-
createClientSslContext
public static javax.net.ssl.SSLContext createClientSslContext(java.lang.String sslProtocol) throws java.lang.Exception
Creates theOfficeFloor
default clientSSLContext
.- Parameters:
sslProtocol
- SSL protocol. May benull
.- Returns:
OfficeFloor
default clientSSLContext
.- Throws:
java.lang.Exception
- If fails to create theSSLContext
.
-
createSslContext
public javax.net.ssl.SSLContext createSslContext(SourceContext context) throws java.lang.Exception
Description copied from interface:SslContextSource
Creates a newSSLContext
.- Specified by:
createSslContext
in interfaceSslContextSource
- Parameters:
context
-SourceContext
to configure theSSLContext
.- Returns:
- New
SSLContext
ready for use. - Throws:
java.lang.Exception
- If fails to create theSSLContext
(possibly because a protocol or cipher is not supported).
-
-