java.lang.Object
io.javalin.community.ssl.SSLConfig
Data class to hold the configuration for the plugin.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConfiguration for the SSL (secure) connector, meant to be accessed using its setters. -
Field Summary
FieldsModifier and TypeFieldDescriptionConsumer<org.eclipse.jetty.server.ServerConnector>Deprecated, for removal: This API element is subject to removal in a future version.final booleanDisables the handler that adds an "Alt-Svc" header to any non HTTP/3 response.final booleanEnables HTTP/3 Support.Host to bind to.booleanToggle HTTP/2 Supportfinal intUDP Port to use on the HTTP/3 connector.booleanToggle the default http (insecure) connector.intPort to use on the http (insecure) connector.booleanEnable http to https redirection.booleanToggle the default https (secure) connector.intPort to use on the SSL (secure) connector.Security provider to use for the SSLContext.booleanDisable SNI checks.TLS Security configuration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigConnectors(Consumer<org.eclipse.jetty.server.ServerConnector> configConnectors) Consumer to configure the differentServerConnectorthat will be created.voidkeystoreFromClasspath(String keyStoreFile, String keyStorePassword) Load a key store from the classpath.voidkeystoreFromInputStream(InputStream keyStoreInputStream, String keyStorePassword) Load a key store from a given input stream.voidkeystoreFromPath(String keyStorePath, String keyStorePassword) Load a key store from a given path in the system.voidpemFromClasspath(String certificateFile, String privateKeyFile) Load pem formatted identity data from the classpath.voidpemFromClasspath(String certificateFile, String privateKeyFile, String privateKeyPassword) Load pem formatted identity data from the classpath.voidpemFromInputStream(InputStream certificateInputStream, InputStream privateKeyInputStream) Load pem formatted identity data from a given input stream.voidpemFromInputStream(InputStream certificateInputStream, InputStream privateKeyInputStream, String privateKeyPassword) Load pem formatted identity data from a given input stream.voidpemFromPath(String certificatePath, String privateKeyPath) Load pem formatted identity data from a given path in the system.voidpemFromPath(String certificatePath, String privateKeyPath, String privateKeyPassword) Load pem formatted identity data from a given path in the system.voidpemFromString(String certificateString, String privateKeyString) Load pem formatted identity data from a given string.voidpemFromString(String certificateString, String privateKeyString, String privateKeyPassword) Load pem formatted identity data from a given string.voidwithTrustConfig(Consumer<TrustConfig> trustConfigConsumer) Trust configuration as a consumer.
-
Field Details
-
host
Host to bind to. -
insecure
public boolean insecureToggle the default http (insecure) connector. -
secure
public boolean secureToggle the default https (secure) connector. -
securePort
public int securePortPort to use on the SSL (secure) connector. -
insecurePort
public int insecurePortPort to use on the http (insecure) connector. -
redirect
public boolean redirectEnable http to https redirection. -
http2
public boolean http2Toggle HTTP/2 Support -
sniHostCheck
public boolean sniHostCheckDisable SNI checks.- See Also:
-
tlsConfig
TLS Security configuration -
enableHttp3
public final boolean enableHttp3Enables HTTP/3 Support. Disabled by default because it is not yet working on Jetty.- See Also:
-
disableHttp3Upgrade
public final boolean disableHttp3UpgradeDisables 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:
-
http3Port
public final int http3PortUDP Port to use on the HTTP/3 connector. Disabled by default because it is not yet working on Jetty.- See Also:
-
inner
-
configConnectors
@Deprecated(forRemoval=true, since="5.3.2") public Consumer<org.eclipse.jetty.server.ServerConnector> configConnectorsDeprecated, for removal: This API element is subject to removal in a future version.UseconfigConnectors(Consumer<ServerConnector>)instead, 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
Security provider to use for the SSLContext.
-
-
Constructor Details
-
SSLConfig
public SSLConfig()
-
-
Method Details
-
pemFromPath
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
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
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(String certificateFile, String privateKeyFile, 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(InputStream certificateInputStream, 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(InputStream certificateInputStream, InputStream privateKeyInputStream, 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
Load pem formatted identity data from a given string.- Parameters:
certificateString- PEM encoded certificate chain.privateKeyString- PEM encoded private key.
-
pemFromString
public void pemFromString(String certificateString, String privateKeyString, 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
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
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
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
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
Trust configuration as a consumer.- Parameters:
trustConfigConsumer- consumer to configure the trust configuration.
-
configConnectors(Consumer<ServerConnector>)instead, access modifier will be changed to private in the next major release.