{"id":10984,"date":"2019-05-29T08:59:45","date_gmt":"2019-05-29T12:59:45","guid":{"rendered":"https:\/\/qxf2.com\/blog\/?p=10984"},"modified":"2019-05-29T08:59:45","modified_gmt":"2019-05-29T12:59:45","slug":"old-ssl-certificate-being-served-by-nginx","status":"publish","type":"post","link":"https:\/\/qxf2.com\/blog\/old-ssl-certificate-being-served-by-nginx\/","title":{"rendered":"Old SSL certificate being served by nginx"},"content":{"rendered":"<p>I had let the SSL certificate on <a href=\"https:\/\/wisdomofreddit.com\">one of my properties<\/a> expire. I purchased a new certificate and installed it on the server. But the server seemed to still return the old, expired certificate. I had restarted the nginx service several times and yet nothing happened. I ended up spending an annoying amount of time on this issue as StackOverflow + Google were not helpful. So I thought I would blog my solution here in case someone else is having trouble too.<\/p>\n<h3>Cause<\/h3>\n<p>Turns out I had an nginx process running the background even after I successfully executed <code>sudo service nginx stop<\/code>. That meant the command I was using to restart nginx was not actually restarting the process that I needed! I suspect this was because I did not start nginx using the &#8216;service&#8217; command in the first place. <\/p>\n<h3>Solution<\/h3>\n<p>0. Stop the current nginx process <code>sudo service nginx stop<\/code><br \/>\n&nbsp;<br \/>\n1. Kill the nginx process as opposed to restarting or reloading the nginx service<br \/>\na. <code>ps -ef|grep nginx<\/code> and note down the process id (in my case two ids were present)<br \/>\nb. <code>kill -9 $process_id_from_1a<\/code><br \/>\n&nbsp;<br \/>\n2. <code>ps -ef|grep nginx<\/code> and make sure no nginx processes exist<br \/>\n&nbsp;<br \/>\n3. <code>sudo service nginx start<\/code><\/p>\n<p>That&#8217;s it!<br \/>\n&nbsp;<\/p>\n<h3>Asides<\/h3>\n<p>I found the following useful as part of my debugging:<br \/>\na) To check the dates of a certificate: <code>echo | openssl s_client -connect wisdomofreddit.com:443 | openssl x509 -noout -dates<\/code><br \/>\nb) <code>nginx -t<\/code> to see errors parsing an nginx conf file<br \/>\nc) There are several online &#8216;SSL Checkers&#8217; that you can use to see what is wrong with your certificate. I did not know that until I hit this issue \ud83d\ude42<br \/>\n&nbsp;<br \/>\n<strong>Note:<\/strong> There are several reasons why your new SSL certificate may not be installed correctly. This post happens to be about one reason that I encountered<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had let the SSL certificate on one of my properties expire. I purchased a new certificate and installed it on the server. But the server seemed to still return the old, expired certificate. I had restarted the nginx service several times and yet nothing happened. I ended up spending an annoying amount of time on this issue as StackOverflow [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[79],"tags":[],"class_list":["post-10984","post","type-post","status-publish","format-standard","hentry","category-misc"],"_links":{"self":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts\/10984","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/comments?post=10984"}],"version-history":[{"count":5,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts\/10984\/revisions"}],"predecessor-version":[{"id":10989,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/posts\/10984\/revisions\/10989"}],"wp:attachment":[{"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/media?parent=10984"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/categories?post=10984"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qxf2.com\/blog\/wp-json\/wp\/v2\/tags?post=10984"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}