Generate a self-signed server and client certificates with OpenSSL (2024)

This is the definitive guide to create secure certificates, for both servers and clients, using OpenSSL.

Procedure

On Windows, it is recommended to use Chocolatey to install OpenSSL and its dependencies. The command line is simply choco install openssl.

  • Create the Root Certification Authority (CA)
  • Generate a Certificate Signing Request (CSR) – Server
  • Generate a Certificate Signing Request (CSR) – Client
  • Process a Certificate Signing Request (CSR) on the Root Certificate Authority (CA)

Root Certification authority (CA)

  1. Generate the Root CA Private Key using the following command line:openssl ecparam -name prime256v1 -genkey -noout -out ca.key. Every certificate must have a corresponding private key.
  2. Generate the Root CA Certificate (Certificate Authority) using the following command line: openssl req -new -x509 -sha256 -key ca.key -out ca.crt.
  3. Enter the information about the CA (the certificate will be generated in the ca.crt file):
    Country Name (2 letter code) [AU]:USState or Province Name (full name) [Some-State]:CALocality Name (eg, city) []:ToontownOrganization Name (eg, company) [Internet Widgits Pty Ltd]:Acme inc.Organizational Unit Name (eg, section) []:SecurityCommon Name (e.g. server FQDN or your name) []:acme.comEmail Address []:security@acme.com
  4. Install the certificate.

Note that the certificate must be installed on the server and on all of the clients to validate the legitimacy of issued certificates. Some browsers also have particularities which are described in the topic.

Server certificate

These steps are usually performed on each server or device for which you intend to request a certificate. Install OpenSSL if it is not present. The alternative is to securely deploy the private key to the destination server at the same time as the certificate. It is recommended to use this last approach only if you must adhere to scripted deployments to follow CloudOps/DevOps practices.

  1. Generate the Server Certificate Private Key using the following command line: openssl ecparam -name prime256v1 -genkey -noout -out server.key (256bit private key in the server.key file). Every certificate must have a corresponding private key.
  2. Generate the server Certificate Signing Request (CSR) using the following command line: openssl req -new -sha256 -key server.key -out server.csr. This request will later be processed on the Root CA server.
  3. Enter the information about the server certificate (the exact FQDN that is used by the server must be specified). For Example:
    Country Name (2 letter code) [AU]:USState or Province Name (full name) [Some-State]:CALocality Name (eg, city) []:ToontownOrganization Name (eg, company) [Internet Widgits Pty Ltd]:Acme inc.Organizational Unit Name (eg, section) []:SecurityCommon Name (e.g. server FQDN or your name) []:vault.acme.comEmail Address []:security@acme.com
  4. Enter a password into the prompt, using a password manager as well as a strong password generator is essential.
  5. Transfer the server.csr file to the Root CA.
  6. Process the request by following the instructions below.
  7. Deploy the certificate.

Client certificate

Follow the same procedure as for the Server certificate, but you must adapt two attributes of the information you enter to your needs, namely the Common Name and the Email Address.

Common Name (e.g. server FQDN or your name) []:John DoeEmail Address []:JohnDoe@acme.com

Process a Certificate Signing Request (CSR) on the Root Certificate Authority (CA)

Process the CSR by generating a certificate.

Generate it using the following command line, where the server.csr has been generated on the server:openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 1000 -sha256

This results in the certificate being generated in the server.crt file. You must deploy it to the server where you generated the CSR.

Generate a self-signed server and client certificates with OpenSSL (2024)
Top Articles
What is OMS? Why was my order rejected by OMS?
FCA Full Form - Eligibility, Difference Between CA and FCA
Bleak Faith: Forsaken – im Test (PS5)
What Are Romance Scams and How to Avoid Them
1970 Chevelle Ss For Sale Craigslist
T Mobile Rival Crossword Clue
Mcoc Immunity Chart July 2022
Puretalkusa.com/Amac
The Many Faces of the Craigslist Killer
Aquatic Pets And Reptiles Photos
Spelunking The Den Wow
Hmr Properties
Athens Bucket List: 20 Best Things to Do in Athens, Greece
How Much Is Tj Maxx Starting Pay
Gwdonate Org
Moparts Com Forum
Star Wars: Héros de la Galaxie - le guide des meilleurs personnages en 2024 - Le Blog Allo Paradise
Talbots.dayforce.com
Rqi.1Stop
Www Va Lottery Com Result
Colonial Executive Park - CRE Consultants
Spiritual Meaning Of Snake Tattoo: Healing And Rebirth!
Is Holly Warlick Married To Susan Patton
11526 Lake Ave Cleveland Oh 44102
October 19 Sunset
RFK Jr., in Glendale, says he's under investigation for 'collecting a whale specimen'
2016 Honda Accord Belt Diagram
Sinfuldeeds Vietnamese Rmt
Family Fare Ad Allendale Mi
7543460065
Ursula Creed Datasheet
Ktbs Payroll Login
Ashoke K Maitra. Adviser to CMD's. Received Lifetime Achievement Award in HRD on LinkedIn: #hr #hrd #coaching #mentoring #career #jobs #mba #mbafreshers #sales…
All Obituaries | Sneath Strilchuk Funeral Services | Funeral Home Roblin Dauphin Ste Rose McCreary MB
Sofia With An F Mugshot
Weather In Allentown-Bethlehem-Easton Metropolitan Area 10 Days
Owa Hilton Email
3 bis 4 Saison-Schlafsack - hier online kaufen bei Outwell
Unveiling Gali_gool Leaks: Discoveries And Insights
Craigslist Com St Cloud Mn
FedEx Authorized ShipCenter - Edouard Pack And Ship at Cape Coral, FL - 2301 Del Prado Blvd Ste 690 33990
Quaally.shop
Craigslist St Helens
Lesson 5 Homework 4.5 Answer Key
Oefenpakket & Hoorcolleges Diagnostiek | WorldSupporter
Naomi Soraya Zelda
Craigslist Free Cats Near Me
Wera13X
Arnold Swansinger Family
Naughty Natt Farting
Latest Posts
Article information

Author: Carlyn Walter

Last Updated:

Views: 6632

Rating: 5 / 5 (70 voted)

Reviews: 93% of readers found this page helpful

Author information

Name: Carlyn Walter

Birthday: 1996-01-03

Address: Suite 452 40815 Denyse Extensions, Sengermouth, OR 42374

Phone: +8501809515404

Job: Manufacturing Technician

Hobby: Table tennis, Archery, Vacation, Metal detecting, Yo-yoing, Crocheting, Creative writing

Introduction: My name is Carlyn Walter, I am a lively, glamorous, healthy, clean, powerful, calm, combative person who loves writing and wants to share my knowledge and understanding with you.