Create SSL Certificate and install in Xampp

HTTPS, it’s a secure HTTP protocol. With the web becoming part of a day to day life people expect almost all application and services should be web enabled and it will happen soon. As huge transactions are done on the web we need some kind of security that will prevent data theft, data sniffing. Secure HTTP plays a very crucial role in protecting the web. Below we will see how we can get SSL Certificate for Xampp.

When we develop any web base application it is always better to provide support for https. Generally it happens that we develop our application with HTTP protocol in mind and when security comes in app may fail to act as expected. So add SSL certificate in the development phase itself.

There might be the case that you won’t be able to buy the SSL certificate in development phase, in this scenario its always advised to generate and install Self Signed SSL Certificate and later when you decide to move to production you can buy an authentic certificate from companies like VeriSign Inc.

Here we will see how we can generate SSL certificate using Open SSL and install it on Xampp server for Windows.

If while running any of below commands you get any error regarding openssl.cnf then set the correct file with below command

1. Generate a Private Key
Command: openssl genrsa -des3 -out server.key 1024
Screen:

2. Generate Certificate Signing Request
Command: openssl req -new -key server.key -out server.csr
Screen:

Here the command might need a config parameter. This is not required but its needed when openssl couldnt find the configration file.

3. Sign the Certificate
Command: openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Screen:

3. Install and Configure the Certificate
After this, you will have server.key and server.crt files that you need to copy to some directory that can be easily accessed by apache. Copy both files to say crypt directory and configure the SSL Conf for website or app. Following shows the basic SSL configuration.

4. Restart the apache server and access the application/site with HTTPS.

Conclusion

In this article, we have seen how you can get self-signed SSL Certificate for Xampp and use it for your local application testing.

7 Comments
  1. guest
    May 19, 2014 | Reply
  2. July 23, 2012 | Reply
  3. Caveman
    October 17, 2011 | Reply
  4. Louie Nohay
    October 11, 2011 | Reply
  5. kanel
    November 9, 2010 | Reply
  6. rodel
    January 20, 2010 | Reply
  7. dhanu
    November 2, 2009 | Reply

Add a Comment

Your email address will not be published. Required fields are marked *