The process for creating
self-signed certificates for Windows is the same as it is for UNIX
with one difference. Unlike a server certificate for UNIX, a server
certificate for Windows must contain the server certificate and server
private key file in the same file. This file is called a PKCS#12 file.
The file extension
for PKCS#12 files is .p12 or .pfx. You can use OpenSSL to convert
a UNIX server certificate and key file into a PKCS#12 file.
Follow these steps to create the self-signed server certificates for the Windows SPD
Server.
Assume the following SPD Server installation:
Host name: winbox.win.sslt.com
-
Using OpenSSL in the
myssl working directory, submit a certificate request to generate
a new key for the Windows server certificate. Name the server key
file “private/TestingServerWin.key.pem”. Name the request
file “TestingServerWin.req”.
>openssl req -config openssl.cnf -new -newkey rsa:1024
-keyout private/TestingServerWin.key.pem -out TestingServerWin.req –nodes
You will be asked to
enter the following information. Substitute information for your configuration.
Country Name (2 letter code) [XX]:US
State or Province Name (full name) []:North Carolina
Locality Name (eg, city) [Default City]:Cary
Organization Name (eg, company) [Default Company Ltd]:SSL Testing
Organizational Unit Name (eg, section) []:ABCD
Common Name (eg, your name or your server's hostname) []:winbox.win.sslt.com
Email Address []: <cr>
Please enter the following 'extra' attributes
A challenge password []: <cr>
An optional company name []:<cr>
-
Create (sign) the new
server certificate with the “root” CA and the certificate
request.
>openssl ca -config openssl.cnf -cert certs/TestingCA.pem
-keyfile private/TestingCA.key.pem -in TestingServerWin.req
-out certs/TestingServerWin.pem
You will be asked to
enter a pass phrase. Enter the secret password that you used to create
your client certificate.
Enter pass phrase for private/TestingCA.key.pem:
If everything is in
order, you will be prompted as follows. Enter Y at each prompt to
sign and commit the certificate.
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
-
Verify the server certificate
as follows:
> openssl verify -verbose -CAfile certs/TestingCA.pem certs/TestingServerWin.pem
Note: Your server certificate can
only be used if your server is running on winbox.win.sslt.com. You
will need additional server certificates that use the same “root”
CA for any other server hosts in your configuration. Repeat the steps
above for any additional Windows server hosts in your configuration.
Use the following OpenSSL
command to create a .p12 file that contains the Windows server certificate
and key file. The command creates a .p12 file named “mywin.p12”.
>openssl pkcs12 -export -in certs/TestingServerWin.pem
-inkey private/TestingServerWin.key.pem -export -out mywin.p12
You will be asked to
enter and verify an export password as follows. Enter any secret password
and save it for later use.
Enter Export Password: