How to set up SSL (TLS) / HTTPS on Spring Boot using AES-256?
Asked Answered
A

3

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?

Ahithophel answered 22/5, 2015 at 19:31 Comment(4)
What errors are you getting (if any)?Confidential
Just edited my question. Sorry! The app itself throws no exception, but every request results in 0 EMPTY RESPONSE.Ahithophel
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.Grade
@Grade 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 :/Ahithophel
A
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
Ahithophel answered 27/5, 2015 at 18:3 Comment(0)
A
1

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

Artificer answered 12/11, 2015 at 18:45 Comment(0)
W
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 ?)

Withrow answered 23/5, 2017 at 11:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.