Wednesday, April 30, 2014

Certificate for HTTPS Server

1- Create private/public keys
openssl genrsa -out prv.key 2048

2- Create certificate request
openssl req -new -key prv.key -out cert.csr

3- Create self-signed root authority certificate
openssl req -new -x509 -days 1826 -key prv.key -out ca.crt

4- Sign the certificate request (csr file)
openssl x509 -req -in cert.csr -CA ca.crt -CAkey prv.key -CAcreateserial -out signedCert.crt -days 500

Please note I used same private key for both CA and certificate, that can be different.
To deploy signed certificate the private key and signed  certificated should be copied to proper location and configuration.

No comments: