I do not have any idea how to generate self-signed SSL certificate for Apache on Windows Vista, but I have to do that.

How I can do that?

link|improve this question
feedback

1 Answer

up vote 2 down vote accepted

You can install OpenSSL for Windows, which is free.

After installation, open command line (cmd.exe), go to installation directory and run appropriate openssl commands.

openssl.exe req -x509 -newkey rsa:2048 -keyout server.key -out server.crt -days 1000 -nodes

This generates server.key (private key for your Apache) and server.crt (self-signed certificate). Remember to protect your private key.

For installation to Apache2 (in Linux):

sudo a2enmod ssl
sudo a2ensite default-ssl
nano /etc/apache2/sites-enabled/default-ssl

Change correct paths to following lines (paths to your new key and certificate):

SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.crt
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

Save and run /etc/init.d/apache2 restart (or if your distribution uses some different way, not that command).

link|improve this answer
hi, thank for reply. I have already install apache with open SSL, so is there any need to separately install openSSL on vista. I have configure my site with apache and its working fine with http. But I have to do the same for https. please reply me. – Lokesh Paunikar Feb 24 '11 at 8:36
@Lokesh: No, you don't need to install OpenSSL separately. The openssl.exe tool (and required libraries) should be included with an SSL-enabled Apache distribution. Just go into Apache's conf\extra folder and edit the httpd-ssl.conf file, then make sure it's being Include'd from your main httpd.conf file. – afrazier Feb 24 '11 at 15:40
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.