{"id":2483,"date":"2016-05-23T08:11:05","date_gmt":"2016-05-23T15:11:05","guid":{"rendered":"http:\/\/www.wellgolly.com\/?p=2483"},"modified":"2016-05-23T08:19:22","modified_gmt":"2016-05-23T15:19:22","slug":"re-negotiation-error-in-apache-logs","status":"publish","type":"post","link":"https:\/\/www.wellgolly.com\/?p=2483","title":{"rendered":"Re-negotiation error in Apache logs"},"content":{"rendered":"<p>After refactoring a site and implementing https for all pages on it, I started looking closely at the logs. I was getting lots of error messages with things like, &#8216;routines:SSL3_ACCEPT:unsafe legacy renegotiation&#8217; and &#8216;Re-negotiation failed&#8217;, so I started looking into it. I was also vaguely aware of BEAST and RC4 weaknesses so I wanted to secure the Apache server as much as possible as well.<\/p>\n<p>The first thing I found was a reference to the <a href=\"https:\/\/mozilla.github.io\/server-side-tls\/ssl-config-generator\"\/>Mozilla Server Side TLS Config Generator<\/a>. It gives a very long list of ciphers that are appropriate for your web server and client needs.<\/p>\n<p>It also suggests using mod_headers to implement HSTS, which according to Wikipedia, \u201cHTTP Strict Transport Security (HSTS) is a web security policy mechanism which helps to protect websites against protocol downgrade attacks and cookie hijacking.\u201d<\/p>\n<p>I didn\u2019t see headers in my mods-available list and looking at the output of phpinfo();, it does not appear to have been implemented. To install mod_headers on Ubuntu you just need to run a simple command.<br \/>\n<pre><code class=\"preserve-code-formatting\">\nsudo a2enmod headers\nsudo service apache2 restart<\/code><\/pre><\/p>\n<p>Now my mods look like this:<br \/>\n<img src='\/images\/Apache_mods.png' alt='Apache mods' \/><\/p>\n<p>My old SSLCipherSuite was very short,<br \/>\n<code class=\"preserve-code-formatting\">SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:!SSLv2:+EXP:+eNULL<\/code><br \/>\nThe new one is a monster<br \/>\n<pre><code class=\"preserve-code-formatting\">\nSSLCipherSuite&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS<\/code><\/pre><\/p>\n<p>I have no idea what most of these are, but I\u2019m sure the good folks at Mozilla do.<\/p>\n<p>The last thing they recommend is that you implement OCSP Stapling. The details are complicated, but it basically speeds up the verification of the certificate.<\/p>\n<p>After adding the new lines in the appropriate place in my sites-available file for the site, I restarted Apache and everything is running fine. In the fifteen minutes it took to write this up, I have had no negotiation messages in the error log.<\/p>\n<p>Once you have implemented the changes, test your site at <a href=\"https:\/\/www.ssllabs.com\/ssltest\/\">SSLabs<\/a>. I got an A+.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After refactoring a site and implementing https for all pages on it, I started looking closely at the logs. I was getting lots of error messages with things like, &#8216;routines:SSL3_ACCEPT:unsafe legacy renegotiation&#8217; and &#8216;Re-negotiation failed&#8217;, so I started looking into it. I was also vaguely aware of BEAST and RC4 weaknesses so I wanted to &hellip; <a href=\"https:\/\/www.wellgolly.com\/?p=2483\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Re-negotiation error in Apache logs<\/span><\/a><\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-2483","post","type-post","status-publish","format-standard","hentry","category-computers"],"_links":{"self":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/2483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2483"}],"version-history":[{"count":0,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=\/wp\/v2\/posts\/2483\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wellgolly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}