- java.lang.Object
-
- io.javalin.community.ssl.SSLConfig
-
public class SSLConfig extends java.lang.ObjectData class to hold the configuration for the plugin.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSSLConfig.InnerConfigConfiguration for the SSL (secure) connector, meant to be accessed using its setters.
-
Field Summary
Fields Modifier and Type Field Description java.util.function.Consumer<org.eclipse.jetty.server.ServerConnector>configConnectorsDeprecated, for removal: This API element is subject to removal in a future version.Use#configConnectors(Consumerinstead, access modifier will be changed to private in the next major release.) booleandisableHttp3UpgradeDisables the handler that adds an "Alt-Svc" header to any non HTTP/3 response.booleanenableHttp3Enables HTTP/3 Support.java.lang.StringhostHost to bind to.booleanhttp2Toggle HTTP/2 Supportinthttp3PortUDP Port to use on the HTTP/3 connector.SSLConfig.InnerConfiginnerbooleaninsecureToggle the default http (insecure) connector.intinsecurePortPort to use on the http (insecure) connector.booleanredirectEnable http to https redirection.booleansecureToggle the default https (secure) connector.intsecurePortPort to use on the SSL (secure) connector.java.security.ProvidersecurityProviderSecurity provider to use for the SSLContext.booleansniHostCheckDisable SNI checks.TLSConfigtlsConfigTLS Security configuration
-
Constructor Summary
Constructors Constructor Description SSLConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigConnectors(java.util.function.Consumer<org.eclipse.jetty.server.ServerConnector> configConnectors)Consumer to configure the differentServerConnectorthat will be created.voidkeystoreFromClasspath(java.lang.String keyStoreFile, java.lang.String keyStorePassword)Load a key store from the classpath.voidkeystoreFromInputStream(java.io.InputStream keyStoreInputStream, java.lang.String keyStorePassword)Load a key store from a given input stream.voidkeystoreFromPath(java.lang.String keyStorePath, java.lang.String keyStorePassword)Load a key store from a given path in the system.voidpemFromClasspath(java.lang.String certificateFile, java.lang.String privateKeyFile)Load pem formatted identity data from the classpath.voidpemFromClasspath(java.lang.String certificateFile, java.lang.String privateKeyFile, java.lang.String privateKeyPassword)Load pem formatted identity data from the classpath.voidpemFromInputStream(java.io.InputStream certificateInputStream, java.io.InputStream privateKeyInputStream)Load pem formatted identity data from a given input stream.voidpemFromInputStream(java.io.InputStream certificateInputStream, java.io.InputStream privateKeyInputStream, java.lang.String privateKeyPassword)Load pem formatted identity data from a given input stream.voidpemFromPath(java.lang.String certificatePath, java.lang.String privateKeyPath)Load pem formatted identity data from a given path in the system.voidpemFromPath(java.lang.String certificatePath, java.lang.String privateKeyPath, java.lang.String privateKeyPassword)Load pem formatted identity data from a given path in the system.voidpemFromString(java.lang.String certificateString, java.lang.String privateKeyString)Load pem formatted identity data from a given string.voidpemFromString(java.lang.String certificateString, java.lang.String privateKeyString, java.lang.String privateKeyPassword)Load pem formatted identity data from a given string.voidwithTrustConfig(java.util.function.Consumer<TrustConfig> trustConfigConsumer)Trust configuration as a consumer.
-
-
-
Field Detail
-
host
public java.lang.String host
Host to bind to.
-
insecure
public boolean insecure
Toggle the default http (insecure) connector.
-
secure
public boolean secure
Toggle the default https (secure) connector.
-
securePort
public int securePort
Port to use on the SSL (secure) connector.
-
insecurePort
public int insecurePort
Port to use on the http (insecure) connector.
-
redirect
public boolean redirect
Enable http to https redirection.
-
http2
public boolean http2
Toggle HTTP/2 Support
-
sniHostCheck
public boolean sniHostCheck
Disable SNI checks.- See Also:
- Configuring SNI
-
tlsConfig
public TLSConfig tlsConfig
TLS Security configuration
-
enableHttp3
public final boolean enableHttp3
Enables HTTP/3 Support. Disabled by default because it is not yet working on Jetty.- See Also:
- Constant Field Values
-
disableHttp3Upgrade
public final boolean disableHttp3Upgrade
Disables the handler that adds an "Alt-Svc" header to any non HTTP/3 response. Disabled by default because it is not yet working on Jetty.- See Also:
- Constant Field Values
-
http3Port
public final int http3Port
UDP Port to use on the HTTP/3 connector. Disabled by default because it is not yet working on Jetty.- See Also:
- Constant Field Values
-
inner
public SSLConfig.InnerConfig inner
-
configConnectors
@Deprecated(forRemoval=true, since="5.3.2") public java.util.function.Consumer<org.eclipse.jetty.server.ServerConnector> configConnectorsDeprecated, for removal: This API element is subject to removal in a future version.Use#configConnectors(Consumerinstead, access modifier will be changed to private in the next major release.) Consumer to configure the differentServerConnectorthat will be created. This consumer will be called as the last config step for each connector, allowing to override any previous configuration.
-
securityProvider
public java.security.Provider securityProvider
Security provider to use for the SSLContext.
-
-
Method Detail
-
pemFromPath
public void pemFromPath(java.lang.String certificatePath, java.lang.String privateKeyPath)Load pem formatted identity data from a given path in the system.- Parameters:
certificatePath- path to the certificate chain PEM file.privateKeyPath- path to the private key PEM file.
-
pemFromPath
public void pemFromPath(java.lang.String certificatePath, java.lang.String privateKeyPath, java.lang.String privateKeyPassword)Load pem formatted identity data from a given path in the system.- Parameters:
certificatePath- path to the certificate chain PEM file.privateKeyPath- path to the private key PEM file.privateKeyPassword- password for the private key.
-
pemFromClasspath
public void pemFromClasspath(java.lang.String certificateFile, java.lang.String privateKeyFile)Load pem formatted identity data from the classpath.- Parameters:
certificateFile- The name of the pem certificate file in the classpath.privateKeyFile- The name of the pem private key file in the classpath.
-
pemFromClasspath
public void pemFromClasspath(java.lang.String certificateFile, java.lang.String privateKeyFile, java.lang.String privateKeyPassword)Load pem formatted identity data from the classpath.- Parameters:
certificateFile- The name of the pem certificate file in the classpath.privateKeyFile- The name of the pem private key file in the classpath.privateKeyPassword- password for the private key.
-
pemFromInputStream
public void pemFromInputStream(java.io.InputStream certificateInputStream, java.io.InputStream privateKeyInputStream)Load pem formatted identity data from a given input stream.- Parameters:
certificateInputStream- input stream to the certificate chain PEM file.privateKeyInputStream- input stream to the private key PEM file.
-
pemFromInputStream
public void pemFromInputStream(java.io.InputStream certificateInputStream, java.io.InputStream privateKeyInputStream, java.lang.String privateKeyPassword)Load pem formatted identity data from a given input stream.- Parameters:
certificateInputStream- input stream to the certificate chain PEM file.privateKeyInputStream- input stream to the private key PEM file.privateKeyPassword- password for the private key.
-
pemFromString
public void pemFromString(java.lang.String certificateString, java.lang.String privateKeyString)Load pem formatted identity data from a given string.- Parameters:
certificateString- PEM encoded certificate chain.privateKeyString- PEM encoded private key.
-
pemFromString
public void pemFromString(java.lang.String certificateString, java.lang.String privateKeyString, java.lang.String privateKeyPassword)Load pem formatted identity data from a given string.- Parameters:
certificateString- PEM encoded certificate chain.privateKeyString- PEM encoded private key.privateKeyPassword- password for the private key.
-
keystoreFromPath
public void keystoreFromPath(java.lang.String keyStorePath, java.lang.String keyStorePassword)Load a key store from a given path in the system.- Parameters:
keyStorePath- path to the key store file.keyStorePassword- password for the key store.
-
keystoreFromInputStream
public void keystoreFromInputStream(java.io.InputStream keyStoreInputStream, java.lang.String keyStorePassword)Load a key store from a given input stream.- Parameters:
keyStoreInputStream- input stream to the key store file.keyStorePassword- password for the key store.
-
keystoreFromClasspath
public void keystoreFromClasspath(java.lang.String keyStoreFile, java.lang.String keyStorePassword)Load a key store from the classpath.- Parameters:
keyStoreFile- name of the key store file in the classpath.keyStorePassword- password for the key store.
-
configConnectors
public void configConnectors(java.util.function.Consumer<org.eclipse.jetty.server.ServerConnector> configConnectors)
Consumer to configure the differentServerConnectorthat will be created. This consumer will be called as the last config step for each connector, allowing to override any previous configuration.
-
withTrustConfig
public void withTrustConfig(java.util.function.Consumer<TrustConfig> trustConfigConsumer)
Trust configuration as a consumer.- Parameters:
trustConfigConsumer- consumer to configure the trust configuration.
-
-