Rexxer

Some tips for me and other

Apache2(Windows) + Wildcard SSL

I’ve got a .pfx and CA’s crt. I have to add it to my Apache’s SSL config.

1. Collect CA’s certificates in one file – cmd for windows:

copy /B ServerCA.crt + TrustCA.crt mycert.ca-bundle

2. Export a private key:

openssl pkcs12 -in mycert.pfx -nocerts -out mycert_key.pem -nodes

3. Export a certificate:

openssl pkcs12 -in mycert.pfx -nokeys -out mycert.pem

4. Remove passphrase from the certificate:

openssl rsa -in mycert_key.pem -out mycert.key

5. Configure Apache e.g.:

<VirtualHost *:443>
ServerName my.site.net:443
ServerAlias www.my.site.net
DocumentRoot “C:/Apache/htdocs/mysite”
ErrorLog “logs/mysite-error.log”
CustomLog “logs/mysite-access.log” common
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:-SSLv2:+SSLv3:+TLSv1:+EXP:+eNULL
SSLCertificateFile “C:/Apache/conf/ssl/mycert.pem”
SSLCertificateKeyFile “C:/Apache/conf/ssl/mycert.key”
SSLCertificateChainFile “C:/Apache/conf/ssl/mycert.ca-bundle”
<FilesMatch “\.(cgi|shtml|phtml|php)$”>
SSLOptions +StdEnvVars
</FilesMatch>
<Directory “C:/Apache/cgi-bin”>
SSLOptions +StdEnvVars
</Directory>
BrowserMatch “.*MSIE.*” \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog “C:/Apache/logs/ssl_request.log” \
“%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \”%r\” %b”
</VirtualHost>

 

Comments are currently closed.