Get free SSL certificate easily & quickly with this automated script
letsencrypt.org provides 3 months SSL certificates for Free but the process to claim is very tedious and requires signing a bunch of strings manually via openssl
and submitting to the website gethttpsforfree.com which easily takes 10 mins.
This repo automates this process and you get SSL certificate in just a minute.
- Make sure you have
openssl
installed and using Node 17.6.0+ - Clone this repo
- Run
npm i
oryarn
- Create new folders
keys
&temp
. cp .env.example .env
and set variable values.
DOMAIN_PEM_FILENAME
andACCOUNT_PEM_FILENAME
are the names of pem files that need to be copied inside thekeys
folder.
If you don't already have these files, then you can generate them by running:
yarn gen:accountKey
andyarn gen:domainKey
- To generate the SSL certificate, run
yarn start
- In between the steps you'd be prompted to transfer the file generated in the
output
folder of this repo to your server at URL:example.com/.well-known/acme-challenge/<file-generated>
- Once you have done uploading, press enter in the terminal to continue the process.
- The SSL certificate would get saved inside the
keys
folder on successful execution.
NOTE:
If the script throws some error after uploading file to your server, run yarn start
again, press enter when prompted (as you already have the same file ready on the server) and the certificate would get generated successfully.