I set up SSL on my Spring Boot server using RSA (How to configure SSL / HTTPS on Spring?) by following their guide:
keytool -genkey -alias <alias> -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore keystore.p12 -validity 3650
Placed these lines in my application.properties file:
server.port: 8443
server.ssl.key-store: classpath:keystore.p12
server.ssl.key-store-password: <keystore password>
server.ssl.key-password = <key password>
server.ssl.keyStoreType: PKCS12
server.ssl.keyAlias: <alias>
Works like a charm. But when I generate an AES 256 key by running keytool -genseckey -keystore keystore.jck -storetype JCEKS -storepass <store pass> -keyalg AES -keysize 256 -alias <alias> -keypass <key pass>
, and change the .properties file to the new keystore / key values, every request to the server results in 0 EMPTY RESPONSE
. What steps should I follow to configure it successfully?
Redirect HTTP requests to HTTPS To do that in spring boot, we need to add HTTP connector at 8080 port and then we need to set redirect port 8443 . So that any request in 8080 through http, it would be automatically redirected to 8443 and https.
Got it. Solved it. Key algorithms have little to do with the cipher you want to use (AES 256, in my case). Got it to work with a regular RSA, PKCS12 key.
Then, set the next properties in application.properties:
server.ssl.ciphers=ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,TLS_RSA_WITH_AES_256_CBC_SHA256,TLS_RSA_WITH_AES_256_CBC_SHA
server.ssl.protocol=TLS
I had the same issue. Changing JDK 1.6 to 1.8 worked.
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