Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. # Create cert and store
  2. openssl genrsa -out server.key 2048
  3. openssl rsa -in server.key -out server.key
  4. openssl req -sha256 -new -key server.key -out server.csr -subj '/CN=localhost'
  5. openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out localhost.crt
  6.  
  7. # convert to pkcs12, and then convert to Java keystore
  8. openssl pkcs12 -export -in localhost.crt -inkey server.key -out server.p12 -name localhost -CAfile ca.crt -caname root
  9. keytool -importkeystore -deststorepass changeit -destkeypass changeit -destkeystore keystore.jks -srckeystore server.p12 -srcstoretype PKCS12 -srcstorepass changeit -alias localhost
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement