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
opensslinstalled and using Node 17.6.0+ - Clone this repo
- Run
npm ioryarn - Create new folders
keys&temp. cp .env.example .envand set variable values.
DOMAIN_PEM_FILENAMEandACCOUNT_PEM_FILENAMEare the names of pem files that need to be copied inside thekeysfolder.
If you don't already have these files, then you can generate them by running:
yarn gen:accountKeyandyarn 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
outputfolder 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
keysfolder 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.