I have tried boot application with recent version,wanted to make the rest api ssl secured, I have done below Created the keystore and put into project classpath, the server got started , no problem with starting,but not able to send request 8080 or 8443, below are the configuration,
server.ssl.key-store=KeyStore.p12 server.ssl.key-store-password=shashank server.ssl.key-alias=mydomain server.ssl.key-password=shashank
@Bean public TomcatServletWebServerFactory servletContainer() { TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory() { @Override protected void postProcessContext(Context context) { SecurityConstraint securityConstraint = new SecurityConstraint(); securityConstraint.setUserConstraint("CONFIDENTIAL"); SecurityCollection collection = new SecurityCollection(); collection.addPattern("/*"); securityConstraint.addCollection(collection); context.addConstraint(securityConstraint); } }; tomcat.addAdditionalTomcatConnectors(getHttpConnector()); return tomcat; } private Connector getHttpConnector() { Connector connector = new Connector("org.apache.coyote.http11.Http11NioProtocol"); connector.setScheme("https"); connector.setPort(8080); connector.setSecure(true); connector.setRedirectPort(8443); }
INFO 84898 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s):enter image description here 8443 (https) 8080 (https) with context path '/event-processing'
as this is self signed certificate, it says " this certificate is not verfied from third party"
The intention is here is to make https to all rest api's enter image description here