Reputation: 202
I need to enable HTTPS on a Spring Boot 2.0.5 application with a self-signed certificate, however, everything I've found so far in configurations is related to setting a property named
security.require-ssl=true
but it seems that on this Spring Boot version that property is deprecated... is any other way for enabling HTTPS on a Spring Boot app?
Upvotes: 4
Views: 3591
Reputation: 1138
Check the Spring Boot 2.0 Migration Guide which recommends to use WebSecurityConfigurerAdapter
instead of the secure.*
properties. Using matchers you can have fine grained control when to enforce SSL, or just do something similar to ...
http.requiresChannel().anyRequest().requiresSecure() (...)
... in your Adapter configuration to enforce https for any request.
Upvotes: 8