I am aware of this question: embedded tomcat spring boot
however this leaves much to be desired as far as a solution is concerned, Currently I have the following code which works to enable SSL:
TomcatEmbeddedServletContainerFactory tomcat = (TomcatEmbeddedServletContainerFactory) container;
tomcat.addConnectorCustomizers( (connector) -> {
connector.setPort(8443);
connector.setSecure(true);
connector.setScheme("https");
Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler();
protocol.setSSLEnabled(true);
protocol.setKeystoreFile(keystore);
protocol.setKeystorePass(password);
protocol.setKeystoreType("jks");
protocol.setKeyAlias(alias);
}
)
My question is this, if I have a Realm that looks like this in XML:
<Realm classname="foo.bar.baz | bing.bang.bong"
var1 = "xyz"
var2 = "123"
/>
How do I recreate that with embedded tomcat?