How to create ssl certificate for local test environment
Hi there, it’s me again! Today, I’ll guide you through the process of creating an SSL certificate for your local test environment on Ubuntu 20.04. It’s going to be a fun ride, so let’s get started!
In bash shell, run these commands:
1 Create Certificate Authority
|
|
Input some information as required. Please notice to save pass phrase for rootCA.key in a safe place. You will use this many times later.
|
|
Change days as you want. 3650 days mean 10 years. :).
Now we will have two files: rootCA.key and rootCA.pem. Now you ara a certificate provider.
In your client PC, open browser (chrome, firefox…) and import file rootCA.pem to tell browser “I am a valid certificate provider” :).
2 Generate rsa for domain
2.1 Create private key
|
|
2.2 Create csr
|
|
2.3 Create file SAN file
|
|
Content:
|
|
Please notice that you can add as much DNS.x as you want.
3 Create domain certificate
|
|
Change the days as you want. 3650 days mean about 10 years.
Now you have crt, csr, key files for domain. Copy these files to web server (example nginx) and config.