How To Generate SSL Key And CSR In Centos
Description:
If you want to convert website from http to https SSL is required to install in the server.SSL will provide by different organization(Thawte,verisign).Here is the simple steps to create SSL.
Steps:
– Login to the server using root credentials.
-Need to generate serverkey and csr,crt.
– In first step generate server key using the below command,
$ openssl genrsa -des3 -out www.domain.com.key 1024
Generating RSA private key, 1024 bit long modulus
…………………………………++++++
……………………………………………++++++
e is 73547 (0x01001)
Enter pass phrase for www.domain.com.key:
Verifying – Enter pass phrase for www.domain.com.key:
# ls -ltr www.thegeekstuff.*
-rw-r–r– 1 root root 963 Jun 14 10:26 www.domain.com.key
– Generated key is looking like below once,
$nano www.domain.com.key
—–BEGIN RSA PRIVATE KEY—–
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,485B3C6371C9916E
ymehJu/RowzrclMcixAyxdbfzQphfUAk9oK9kK2
jadfoiyqthakLKNqw9z1MoaqkPyqeHevUm26no
AJKIETHKJADFS2BGb0n61/Ksk8isp7evLM4+QY
KAQETKjdiahteksMJOjXLq+vf5Ra299fZPON7yr
—–END RSA PRIVATE KEY—–
– Now generate CSR using the server key,
$openssl req -new -key www.domain.com.key -out www.domain.com.csr
– It will ask the contact details and locations as mention in the below,
Enter pass phrase for www.domain.com.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) [GB]:US
State or Province Name (full name) [Berkshire]:California
Locality Name (eg, city) [Newbury]:Los Angeles
Organization Name (eg, company) [My Company Ltd]:The Tech Stuff
Organizational Unit Name (eg, section) []:IT
Common Name (eg, your name or your server’s hostname) []: techstuff
Email Address []:
Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
– After filling the details reboot the server.
Tags:SSL,SCR,Server key,Open ssl,Open ssl errors,Open ssl bug,SSL installation,SSL configuration
Add Comment