Creating Self-Signed Certificates Open SSL Part 2 : Making Apache HTTP Server SSL enabled.

 

In previous post I have explained how to generate self-signed certificates using openSSL. This post We will see how to use this certificate for a secured web application.

Now lets use these certificates to make a web application secure. For this I have downloaded Apache HTTP Server including OpenSSL and installed from here.

1. First step is to make Apache HTTP Server SSL enabled.

Following the simple steps given below to get SSL enabled

  1. Edit <APACHE_INSTALL_HOME>/config/httpd.conf and uncomment following line
    1. LoadModule ssl_module modules/mod_ssl.so
    2. Include conf/extra/httpd-ssl.conf
  2. Edit <APACHE_INSTALL_HOME>/config/extra/httpd-ssl.conf and update following attributes
    1. SSLCertificateKeyFile <Location of Server.key file, generated as per previous post>
    2. SSLCertificateFile <Location of Server.crt file, generated as per previous post>

 

2. Restart the Server

<APACHE_INSTAL_HOME>/bin/httpd.exe –k restart

3. Install/import certificate to browser/client

Now try to access the server using https

https://server-host.com/

You will notice following error in browser

image

It is expected as the certificates which have mentioned in httpd-ssl.conf file are self-signed not by any well-known third party authority. We need to install/import our own certificate to the browser. For the same

go to  Options>>Advanced>>Encryption tab ( I am using Firefox 4 in this example, if you are using any other browser then this location may be little different)

2011-03-19_1613

Click on “View Certificate” and then “Import” option

2011-03-19_1614

Now locate myCA,cert ( which we have generated in previous post).

2011-03-19_1615

Now we have installed our own Certificate Authority to browser, which has already signed the web server certificate (server.cert & server.key mentioned in httpd-ssl.cnf). Now restart the browser and try to access the server with https protocol. You will able to access index page without any exception or warning.

2011-03-19_1646

Comments

Popular posts from this blog

Composite Design Pattern by example

State Design Pattern by Example

Eclipse command framework core expression: Property tester