I have a requirement where in a Spring Webflux Application I need to listen to HTTP and HTTPS port. I could easily configure HTTPS using
@Bean
public WebServerFactoryCustomizer<NettyReactiveWebServerFactory> customizer() {
return new WebServerFactoryCustomizer<NettyReactiveWebServerFactory>() {
@Override
void customize(NettyReactiveWebServerFactory factory) {
Ssl ssl = new Ssl()
// Your SSL Cusomizations
ssl.setEnabled(true)
ssl.setKeyStore(keystorePath)
ssl.setKeyPassword(keystorePass)
factory.setSsl(ssl)
}
}
}
I am not sure how to add HTTP listener for Netty. For Tomcat Servlet model I have found https://dzone.com/articles/enable-httphttps-spring-boot. Looking a similar setup for Netty Webflux.
This is not supported at the moment. You can watch the following issue in the meantime: https://github.com/spring-projects/spring-boot/issues/12035
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With