[root@ait red5]# ls /etc/letsencrypt/live/ait.csie.cyut.edu.tw/ cert.pem chain.pem fullchain.pem privkey.pem tomcat.cer
[root@ait ~]# host=ait.csie.cyut.edu.tw [root@ait ~]# openssl pkcs12 -export \ -in /etc/letsencrypt/live/$host/fullchain.pem \ -inkey /etc/letsencrypt/live/$host/privkey.pem \ -out /etc/letsencrypt/live/$host/fullchain_and_key.p12 \ -name tomcat Enter Export Password: Verifying - Enter Export Password:
[root@ait ~]# keytool -importkeystore \ -deststorepass password \ -destkeypass password \ -destkeystore /etc/letsencrypt/live/$host/keystore.jks \ -srckeystore /etc/letsencrypt/live/$host/fullchain_and_key.p12 \ -srcstoretype PKCS12 \ -srcstorepass password \ -alias tomcat Existing entry alias tomcat exists, overwrite? [no]: yes
[root@ait ~]# keytool -export \ -alias tomcat \ -file /etc/letsencrypt/live/$host/tomcat.cer \ -keystore /etc/letsencrypt/live/$host/keystore.jks Enter keystore password: Certificate stored in file </etc/letsencrypt/live/ait.csie.cyut.edu.tw/tomcat.cer>
[root@ait ~]# ls /etc/letsencrypt/live/ait.csie.cyut.edu.tw/ cert.pem fullchain_and_key.p12 keystore.jks tomcat.cer chain.pem fullchain.pem privkey.pem