- java.lang.Object
-
- io.javalin.community.ssl.util.SSLUtils
-
public class SSLUtils extends java.lang.ObjectUtility class for SSL related tasks.
-
-
Constructor Summary
Constructors Constructor Description SSLUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.eclipse.jetty.util.ssl.SslContextFactory.ServercreateSslContextFactory(nl.altindag.ssl.SSLFactory sslFactory, SSLConfig config)Helper method to create aSslContextFactoryfrom the SSLFactory.static nl.altindag.ssl.SSLFactorygetSslFactory(SSLConfig config)Helper method to create aSSLFactoryfrom the given config.static nl.altindag.ssl.SSLFactorygetSslFactory(SSLConfig config, boolean reloading)Helper method to create aSSLFactoryfrom the given config.static voidparseIdentity(SSLConfig config, nl.altindag.ssl.SSLFactory.Builder builder)Helper method to parse the given config and add Identity Material to the given builder.static voidparseTrust(TrustConfig config, nl.altindag.ssl.SSLFactory.Builder builder)Helper method to parse the given config and add Trust Material to the given builder.
-
-
-
Method Detail
-
createSslContextFactory
public static org.eclipse.jetty.util.ssl.SslContextFactory.Server createSslContextFactory(nl.altindag.ssl.SSLFactory sslFactory, SSLConfig config)Helper method to create aSslContextFactoryfrom the SSLFactory. This method is used to create the SSLContextFactory for the Jetty server as well as configure the resulting factory.- Parameters:
sslFactory- TheSSLFactoryto use.config- TheSSLConfigto use.- Returns:
- The created
SslContextFactory.
-
getSslFactory
public static nl.altindag.ssl.SSLFactory getSslFactory(SSLConfig config)
Helper method to create aSSLFactoryfrom the given config.- Parameters:
config- The config to use.- Returns:
- The created
SSLFactory.
-
getSslFactory
public static nl.altindag.ssl.SSLFactory getSslFactory(SSLConfig config, boolean reloading)
Helper method to create aSSLFactoryfrom the given config.- Parameters:
config- The config to use.reloading- Whether the SSLFactory is being reloaded or is the first time.- Returns:
- The created
SSLFactory.
-
parseIdentity
public static void parseIdentity(SSLConfig config, nl.altindag.ssl.SSLFactory.Builder builder) throws SSLConfigException
Helper method to parse the given config and add Identity Material to the given builder.- Parameters:
config- The config to use.- Throws:
SSLConfigException- if the key configuration is invalid.
-
parseTrust
public static void parseTrust(TrustConfig config, nl.altindag.ssl.SSLFactory.Builder builder)
Helper method to parse the given config and add Trust Material to the given builder.- Parameters:
config- The config to use.
-
-