Creating self signed certificate


Again this is more an aide memoire.

Whilst waiting for my real SSL certificates to be create I wanted to continue my configuration of the server that I am building.

I therefore wanted a self signed certificate to try the config.

mkdir ~/sslselfsign
cd ~/sslselfsign
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
rm -f server.pass.key
openssl req -new -key server.key -out server.csr

 

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) [XX]:GB
State or Province Name (full name) []:County_Name
Locality Name (eg, city) [Default City]:City_Name
Organization Name (eg, company) [Default Company Ltd]:Comany_Name
Organizational Unit Name (eg, section) []:IT
Common Name (eg, your name or your server’s hostname) []:xxxx.xxxxx.com
Email Address []:

Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:

 openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt

you should now have 3 files

ls -l

server.crt
server.csr
server.key

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s