I am trying to set up SSL in my Dropwizard server. I have got my SSL from GoDaddy and have received a couple of files from them namely:
I have added the gd_bundle-g2-g1.crt certificate with alias root in my keystore and have added the other one with my domain alias.
My .yml configuration file looks like this: (I have just pasted the relevant section of the .yml file)
server:
applicationConnectors:
- type: http
port: 8080
- type: https
port: 8443
keyStorePath: keystore/myKeyStore.jks
keyStorePassword: "myPassword"
validateCerts: true
adminConnectors:
- type: http
port: 8081The problem is that whenever I am trying to launch my server I am receiving the following error:
java.lang.IllegalStateException: Unable to retrieve certificate chain
When I set the validateCerts as false in the .yml above then, for obvious reason, this error goes away but when I try to access the URL I get: Connection closed error when trying to access the URL
I seem to be stuck real bad. My server is working perfectly with http but https just doesn't work! :( Given my end goal of making https work and my current scenario, I have the following questions:
Appreciate your help! :-)
PS: I have asked the same question in stackoverflow and followed the comment by Austin but even that didn't seem to work.
Hi, I have another way to solve in Linux. http://stackoverflow.com/a/43593650/1378817
For others that will come I solved this problem in Dropwizard/Linux in another way.
First generate your keys:
keytool -genkey -alias <aliasname> -keyalg RSA -keystore keystore.jks -keysize 2048Then generate tour CSR:
keytool -certreq -alias <aliasname> -file csr.txt -keystore keystore.jksOpen your csr.txt and copy all content. Go to GoDaddy paste it and download the two .crt files as Others.
Then concatenate the contents of b78*********.crt and gd_bundle-g2-g1.crt (make sure that the contents of the b78*********.crt are before the other file). Let's refer to that file as all_combined.crt from now.
Finally combine your trust certs with your .jks:
keytool -import -trustcacerts -keystore keystore.jks -storepass <keystorepassword> -alias <aliasname> -file all_combined.crtThen on your .yml file let this:
applicationConnectors:
- type: http
port: 8080
- type: https
port: 8443
keyStorePath: keystore.jks
keyStorePassword: <keystorepassword>
keyStoreType: JKS
supportedProtocols: [TLSv1, TLSv1.1, TLSv1.2]