Arif’s Scratch Pad

Self Sign Certificate

First create a Private Key to sign the certificate

1
openssl genrsa -des3 -out server.key 1024

Create CSR

1
2
3
openssl req -new -out arif-ali.csr -key server.key \
-subj "/C=GB/ST=South Yorkshire/L=Sheffield/O=Example Inc/OU=Web Dept/CN=example.com" \
-out server.csr

Decrypt the private key

1
2
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key

Sign the Certificate with the private key

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