Difference between revisions of "Installing SSL certificate in Apache"

From Notes_Wiki
(Created page with "<yambe:breadcrumb>Security_tips|Security tips</yambe:breadcrumb> =Using startssl SSL certificates for HTTPS= It is good to have HTTPS certificate signed by recognized CA inst...")
 
m
Line 28: Line 28:
#:</pre>
#:</pre>
# Restart apache and verify that certificate is working as expected.
# Restart apache and verify that certificate is working as expected.
==Securing Apache SSL configuration==
Default SSL configuration of apache is vulnerable to many attacks.  We can improve apache SSL configuration as follows:
#Edit /etc/httpd/conf/ssl.conf and replace following two values
#:<pre>
#::SSLProtocol TLSv1 TLSv1.1 TLSv1.2 -SSLv2 -SSLv3
#::SSLCipherSuite AES256+EECDH:AES256+EDH
#::</pre>
#Also append following line:
#:<pre>
#::SSLHonorCipherOrder On
#:</pre>
#Check ranking of HTTPS security using https://www.ssllabs.com/ssltest/index.html
<yambe:breadcrumb>Security_tips|Security tips</yambe:breadcrumb>

Revision as of 09:34, 2 June 2015

<yambe:breadcrumb>Security_tips|Security tips</yambe:breadcrumb>

Using startssl SSL certificates for HTTPS

It is good to have HTTPS certificate signed by recognized CA instead of using self-signed certificate. One very viable option for simple HTTPS certificate is http://www.startssl.com Using this website one can generate SSL certificates recognized by all popular browsers for free. Steps for obtaining such certificate are:

  1. Register on website and provide authetication code from email
  2. Wait for another acceptance email with code and paste same in browser
  3. Generate client certificate to recognize oneself. Take backup of this certificate with password at some safe location.
  4. Go to control panel -> Validation wizard -> Domain name validation
  5. Verify by email ID of domain owner. An email with verification code will be sent to chosen email ID.
  6. Go to control panerl -> Certificate wizard -> SSL/TLS web certificate
  7. Choose simple password and create private key
  8. Download private key and decrypt it with password chosen in previous step. Decoding command is shown on the screen as "openssl rsa -in ssl,key -out ssl.key"
  9. Enter desired TLD and sub-domain for which certificate is being requested
  10. Wait for email confirmation for certificate request
  11. Download the certificate and copy it to server along with key and CA (pem) format with CRL included


Install SSL certificate in apache

For installation of certificate in apache use following steps:

  1. Copy all (certificate, key, CA bundle) to /etc/httpd/conf folder
  2. chmod 400 ssl.key
  3. Edit /etc/httpd/conf.d/ssl.conf and replace appropriate values. Following three values need to be updated:
    SSLCertificateFile /etc/httpd/conf/ssl.crt
    SSLCertificateKeyFile /etc/httpd/conf/ssl.key
    SSLCACertificateFile /etc/httpd/conf/ca-bundle.pem
  4. Restart apache and verify that certificate is working as expected.


Securing Apache SSL configuration

Default SSL configuration of apache is vulnerable to many attacks. We can improve apache SSL configuration as follows:

  1. Edit /etc/httpd/conf/ssl.conf and replace following two values
    SSLProtocol TLSv1 TLSv1.1 TLSv1.2 -SSLv2 -SSLv3
    SSLCipherSuite AES256+EECDH:AES256+EDH
  2. Also append following line:
    SSLHonorCipherOrder On
  3. Check ranking of HTTPS security using https://www.ssllabs.com/ssltest/index.html


<yambe:breadcrumb>Security_tips|Security tips</yambe:breadcrumb>