Skip to main content

Subject Alernative names with Openssl


In this post we will see, how can we create CSR with SAN, which stands for Subject Alternative Names and obviously using openssl command.

For those who do not know what is SAN, let me cover this in short.There are 3 main types of SSL

  •  Standard SSL  :- Used for securing single domain. like www.domain.com, i,e one domain -- one certificate
  • Wild card SSL : - Used for securing multiple sub-domains like home.domain.com office.domain.com in single certificate, i.e multiple subdomain --- single certificate
  • Multi-domain SSL : -- Used for securing multiple domains, like www.domain.com, www.home.com, www.office.net, i,e multiple domains --- single certificate.

So, SAN comes under multiple domains certificate category.

When you purchase a multi-domain certificate from certificate issuing authority ,they give you options of defining SAN along with primary domain.

So, Here we are discussing about how to create CSR(which is required while purchasing the certificate) with SAN itself.And why we are doing this ??

Answer is now a days we see,some Certificate issuing authority , does not include SANs when we purchased a certificate from them,like if I purchased certificate for www.domain.com, the certificate will not include domain.com, which some times creates issues for getting PCI  (Product card industry) certificate for E-commerce sites.

PCI is getting Necessary for E-commerce site now a-days .Lets see then,how to create CSR with SAN

Hopefully you have Linux box with you, with root permission. then do the following

Step 1 : 

Add below lines in file if its not present.
vi /etc/pki/tls/openssl.cnf

[req]
distinguished_name = req_distinguished_name
req_extensions = v3_req


###Now we'll go own down to the v3_req section and make sure that it includes the following:

[ v3_req ]
# Extensions to add to a certificate request
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
subjectAltName = @alt_names  --->>>> This is IMP, if not present , then add this line.

##Then add below line in same file under [ v3_req ]

[alt_names]
DNS.1 = kb.domain.com
DNS.2 = home.domain.net
DNS.3 = systems.domain.com

## ---- > Denotes comments here.

Step 2 :

save the file.

Step 3 :  

Run below command on the linux terminal,replacing the contents of the commands as per your need

openssl req -new -newkey rsa:2048 -nodes -sha256 -out domain.csr -keyout domain.key -subj "/C=us/ST=Florida/L=Jacksonville/O=Company/OU=IT Department/CN=www.domain.com" -config /etc/pki/tls/openssl.cnf

Above command helps you remove some vulnerabilities you might get from PCI Vendor related to SSL Certificate.


Comments

  1. Excellent beat ! I would like to apprentice while you amend your website, how can i subscribe for a blog web site?
    The account helped me a acceptable deal. I had been a little bit acquainted of
    this your broadcast offered bright clear concept

    ReplyDelete
  2. Glad you Liked it! You can subscribe the blog by following through email option which you can find on your right side of webpage.

    ReplyDelete

Post a Comment

Popular posts from this blog

Multiple instances of redis

In the last post I have covered how to install redis server on Centos/Rhel using rpm method and yum method and some troubleshooting skills. In this post i am going to cover how to install and configure redis to run with multiple ports.                                                                           But why we need more ports ? If you have read my earlier post , you already know that by default redis runs on single port 6379, which any one can use it for small website to cache the data. But for heavy website like magento we need to use additional ports along with 6379 to serve different cache from different ports. Like in Magento there is simple cache which is normally stored under /var/cache directory. Then there is Full Page Cache which is stored under /var/full_page_cache...

arbtd: Package isn't signed with proper key

  If you are System Admin and worked on linux machine or servers in your current job or in past. Chances are you might come across linux service abrtd, even if you have not worked on it. but might be through some other work. same thing happened to me, while I was doing my regular work of installing php packages on linux  servers , i came across this error for which spent couple of hours actually to resolve it. T he error was 

Optimization of Redis

In this Post, I am going to cover how to optimized REDIS  (recently i was reading this random blog giving more clear insight on what is redis and what the use of it in real world) instances as per our requirement. if you are not aware about REDIS at all, you can refer to my previous post where i have covered How To install REDIS on Centos/Redhat servers which goes here . How To Create Multiple instances of REDIS which goes here . What is the Best Standard method to configure REDIS which goes here . So, Lets see how to optimize our redis server. few points you need to keep in mind that which are important while doing optimization and we are going to learn more about shortly. For Freelance Work & Queries Contact me by Email Id support@linuxforeveryone.com Remove any errors you are seeing under redis logs Check the amount of cache size your site is using for each port Set proper eviction policy for redis keys Set proper kernel Settings t...