Create CA
Generate private key for CA
openssl genrsa -des3 -out keys/ca.key 1024
Generate CA cert
openssl req -config openssl.conf -new -x509 -days 1001 -key keys/ca.key -out certs/ca.cer
Generate server cert request
Generate private key for server cert
openssl genrsa -out keys/domain.com.key 2048
Generate server certificate request
openssl req -new -key keys/servercert.key -out requests/certreq.txt
Sign certificate request and create certificate
openssl ca -policy policy_anything -config openssl.conf -cert certs/ca.cer -in requests/certreq.txt -keyfile keys/ca.key -days 360 -out certs/servercert.cer
Combine private key and certificate in pkcs12 format for importing into Windows
openssl pkcs12 -export -out servercert.p12 -in servercert.cer -inkey servercert.key
Credits:
http://www.dylanbeattie.net/docs/openssl_iis_ssl_howto.html
http://www.rackspace.com/knowledge_center/article/generate-a-csr-with-openssl
http://www.cs.virginia.edu/~gsw2c/GridToolsDir/Documentation/ImportUserCertificate.htm