-
Notifications
You must be signed in to change notification settings - Fork 4
/
README_HTTPS
27 lines (16 loc) · 1.07 KB
/
README_HTTPS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
To get SSL working:
Download the PEM certificate (just save it as text) to cert.cer
OR
Download PCKS7 cert (text) and save it as cert.p7b
then do:
openssl pkcs7 -print_certs -in cert.p7b -out cert.cer // creates PEM certificate
Next dowload the private key and save that as text too (private_key.txt)
Now we need to generate a PKCS12 keystore with our certificate, which also takes in our private key
openssl pkcs12 -export -in cert.cer -inkey key-PKCS7.txt -out cert.p12
(Password matters! Make it long, as this is the permanent one!)
Finally to convert to Java Key Store, do:
keytool -importkeystore -srckeystore cert.p12 -srcstoretype PKCS12 -destkeystore KeyStore.jks
(Enter the same password 3 times!!! The JKS password must match the key's password, otherwise Play won't work by default!)
done, KeyStore.jks is the final Java Key Store to be used with java apps. Use it in Play by adding this to your production configuration:
play.server.https.keyStore.path="/path_to_your_keystore/KeyStore.jks"
play.server.https.keyStore.password="thePasswordYouUsedThroughoutThisTutorial"