14

I set up SSL on my Spring Boot server using RSA (How to configure SSL / HTTPS on Spring?) by following their guide:

  • Created a new keystore and key using 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?

4
  • 1
    What errors are you getting (if any)?
    – David
    Commented May 22, 2015 at 20:13
  • Just edited my question. Sorry! The app itself throws no exception, but every request results in 0 EMPTY RESPONSE. Commented May 22, 2015 at 21:30
  • Could you edit your question to describe the steps that you took, instead of just pointing to the guide? We have no way of knowing if you actually followed the guide correctly.
    – Kenster
    Commented May 22, 2015 at 22:05
  • @Kenster sorry, I just updated it. I think I'm following the guide correctly because it works, just not with the kind of cipher I need :/ Commented May 25, 2015 at 13:41

3 Answers 3

18

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
1

I had the same issue. Changing JDK 1.6 to 1.8 worked.

0
0

I had a problem with Spring Boot and embedded Tomcat, because my key didn't have 'tomcat' alias ... Creating key with 'tomcat' alias solved problems (embedded Tomcat wasn't picking up other keys ?)

Not the answer you're looking for? Browse other questions tagged or ask your own question.