Step 1 : Generating a Private Key
Open the OpenSSL tool using Terminal/Command Prompt
We create a Private Key that has a 1024 RSA key with Triple-DES encryption. This key is stored as PEM (Privacy Enhanced Email) format which contains ASCII text hence you can read it with a text editor too.
OpenSSL> genrsa -des3 -out mySSL.key 1024
Generating RSA private key, 1024 bit long modulus .............++++++
........++++++
e is 65537 (0x10001)
Enter passphrase for mySSL.key:
Verifying - Enter pass phrase for mySSL.key:
OpenSSL>
Step 2 : Generating CSR Request (Certificate Signing Request)
In Step 1 we created a Private Key, now we need to generate a Certificate Signing Request.
Its a request that is sent to the Certificate Authority (CA) like Verisign who verify the identity of the organization who is requesting the certificate and issues a signed Certificate.
But as we are going to do a Self Signing we do not require a CA, let's see how it is done,
When we run the command for CSR we will be prompted with questions that need to be addressed, these are called as X.509 attributes of a Certificate. You will be prompted to fill the following,
Country Name in ISO format
Full State or Province Name
Locality Name i.e your City
Organization Name
Organizational Unit Name
Common Name
Email Address
OpenSSL> req -new -key server.key -out server.cs
Enter passphrase for server.key:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:New York
Locality Name (eg, city) []:New York
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Code2care Tech
Organizational Unit Name (eg, section) []:IT
Common Name (e.g. server FQDN or YOUR name) []:Code2care
Email Address []:xyz@somedomainname.com
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: your password
An optional company name []:c2c
Step 3 : Generating Self Signed Certificate
Now we will request a Self-signed certificate, for this we need to provide the number of days that this certificate is valid. Once you run this command the certificate file will be generated (for me the location of the file is under XAMPP/etc/ssl.crt/server.crt)
OpenSSL>x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Signature ok
subject=/C=US/ST=New York/L=New York/O=Code2care Tech/OU=I T/CN=Code2care/ emailAddress= xyz@somedomainname.com
Getting Private key
Enter pass phrase for server.key:
OpenSSL>
- [Fix] Error 1020 Cloudflare: Access was denied
- What is an Authorization Code Grant? OAuth 2.0
- Fix: psql: error: connection to server at localhost (::1) port 5432 failed: FATAL: database does not exist
- 100+ SEO Tips to improve your website search ranking
- How to submit website to dmoz directory
- How to check the version of NodeJS installed
- How to enter Rockstar Activation Code?
- Background task activation is spurious error - Windows 10, Office 2016, Office 365
- Angular CLI ng Error: You need to specify a command before moving on. Use --help to view the available commands
- cURL HTTP GET request command examples
- Fix - JioCinema Something Went Wrong Please Try Again Error 8001 while streaming IPL Cricket Live
- How to remove password from pdf file
- How to identify the version of IntelliJ
- Command: How to scp a file to remote server location?
- How to add Widgets to MacBook Desktop
- Setting up RSS feeds notifications within Outlook
- Fix - Website Connection timed out Error Code 522 (Cloudflare)
- How to fix: Please check your network connection (Retry)
- Fix: Could not connect to Redis at 127.0.0.1:6379: Connection refused
- Accept Only 0-9 Numbers RegEx Example
- How to create a New Project in Visual Studio Code (VS Code)
- Top 10 emerging breakthrough trending technologies
- Free Unlimited Calls from MTNL & BSNL Landlines from 1st May 2015
- [Error] zsh: command not found: mvn
- How to Scan iPhone for Virus? Is Antivirus it really required?
- [Solution] Alpine Docker apt-get: not found - Docker
- Take Screenshot on Mac OS X (Keyboard Shortcuts) - Mac-OS-X
- How to change Ping TTL value on macOS - MacOS
- How to install AWS CLI on Ubuntu - AWS
- How to reload Zsh .zshrc Profile - zsh
- How to Get Substring from a String in Python using string slicing - Python
- JavaScript: Count Words in a String - JavaScript
- Calculate Area of a Rectangle - C-Program