Previous examples of how to configure a self signed certificate with Spring Boot 2.x looked something like this
@Component
public class MyTomcatWebServerFactoryCustomizer implements WebServerFactoryCustomizer<TomcatServletWebServerFactory> {
@Override
public void customize(TomcatServletWebServerFactory server) {
server.addConnectorCustomizers(connector -> {
Http11NioProtocol proto = (Http11NioProtocol) connector.getProtocolHandler();
proto.setSSLEnabled(true);
proto.setKeystoreFile(CERTIFICATE_PATH);
proto.setKeystorePass(CERTIFICATE_PASSWORD);
proto.setKeystoreType(KEYSTORE_TYPE);
proto.setKeyAlias(CERTIFICATE_ALIAS);
});
}
}
Spring Boot 3 moves to Tomcat 10 which removes setKeystoreFile, setKeystorePass, setKeystoreType, and setKeyAlias from the base classes for Http11NioProtocol and I am struggling to find the appropriate way to configure these same parameters in the new environment. I have done my due diligence searching the web but I am struggling to find the replacement method for doing this.