Creating keystore.p12 from letsencrypt certificate for spring boot projects:

Creating keystore.p12 from letsencrypt certificate for spring boot projects:

Step 1: Stop your server

If your server is nginx then use the below command to stop the server.

sudo service nginx stop


Step 2: Generating new letsencrypt certificate

This is to create the new letsencrypt certificate, if you already have one certificate then skip this step.

./certbot-auto certonly -a standalone \ -d -d -d

here -d takes all this domains for this certificates, meaning the same certificate can be used for and domains and subdomains.


Step 3: Converting letsencrypt to keystore.p12

go to /etc/letsencrypt/live/YOUR-CERTIFICATE-FOLDER/

sudo openssl pkcs12 -export -in fullchain.pem -inkey privkey.pem -out keystore.p12 -name tomcat -CAfile chain.pem -caname root



Now place keystore.p12 in your src/main/resources folder and configure YOUR_SECRET_PASSWORD in your spring boot’s file:


967 total views, 2 views today

About Mirthbees 678 Articles
Blogger, Innovator, Developer and Enterpreneur. Founder of GuruRecharge, Readymade online recharge script. Lead Developer in

Be the first to comment

Leave a Reply

Your email address will not be published.


This site uses Akismet to reduce spam. Learn how your comment data is processed.