{"id":449,"date":"2018-11-04T21:14:08","date_gmt":"2018-11-05T03:14:08","guid":{"rendered":"http:\/\/zewwy.ca\/?p=449"},"modified":"2019-08-19T20:00:22","modified_gmt":"2019-08-20T01:00:22","slug":"resolving-a-down-ca","status":"publish","type":"post","link":"https:\/\/zewwy.ca\/index.php\/2018\/11\/04\/resolving-a-down-ca\/","title":{"rendered":"Resolving a down CA"},"content":{"rendered":"<h1 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Downed_CA\"><\/span>Downed CA!<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>First off I wanted to address that this wasn&#8217;t the intended post of today, this was suppose to be part 2 of the Global Protect post, which is the second dependency; Certificates. However I recently had to get a new cert at work, and discovered this same issue as I had deployed my CA following a decent blog tutorial online by StealthPuppy, and sure enough the same sight provides a follow up on how to fix a mistake made, we all make them and these are great opportunities to learn, so lets get learning!<\/p>\n<p>So you might happen to open up the Certificate Authority Snap and point it to your CA server, to find this&#8230;. it&#8217;s shutdown&#8230;.<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/PR5IHcW.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/PR5IHcW.png\" alt=\"\" width=\"222\" height=\"48\" \/><\/a>Fear not <a href=\"https:\/\/stealthpuppy.com\/resolving-issues-starting-ca-offline-crl\/\">StealthPuppy has given us some helpful tips<\/a> to resolve this!<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"The_Issue\"><\/span>The Issue<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You might find your certificate authority, in this case, a subordinate certificate authority that is not started, perhaps after a server reboot. Attempting to start the CA, results in this message:<\/p>\n<blockquote><p>The revocation function was unable to check revocation because the revocation server was offline.<br \/>\n0x80092013 (-2146885613 CRYPT_E_REVOCATION_OFFLINE)<\/p><\/blockquote>\n<p>Which looks like this:<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/aWbEmLR.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/aWbEmLR.png\" alt=\"\" width=\"483\" height=\"192\" \/><\/a><\/p>\n<p>In the Application log on the subordinate CA, I can see event id 100 from source CertificationAuthority:<\/p>\n<blockquote><p>Active Directory Certificate Services did not start: Could not load or verify the current CA certificate.  stealthpuppy Issuing CA The revocation function was unable to check revocation because the revocation server was offline. 0x80092013 (-2146885613 CRYPT_E_REVOCATION_OFFLINE).<\/p><\/blockquote>\n<p>As well as, event id 48 from the same source, CertificationAuthority:<\/p>\n<blockquote><p>Revocation status for a certificate in the chain for CA certificate 0 for stealthpuppy Issuing CA could not be verified because a server is currently unavailable.  The revocation function was unable to check revocation because the revocation server was offline. 0x80092013 (-2146885613 CRYPT_E_REVOCATION_OFFLINE).<\/p><\/blockquote>\n<p>Certificate 0 is the subordinate CA\u2019s certificate, issued by the offline Root CA.<\/p>\n<p>I bypassed this portion of the blog as I didn&#8217;t want to have pictures of before the next required step soooo&#8230;.<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"The_Workaround\"><\/span>The Workaround<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Of course, you probably want to get the CA up and running as quickly as possible. The easy way to do that is to disable CRL checking with the following command on the CA server:<\/p>\n<div class=\"mivhak-code-wrapper\">\n<div class=\"ace_scroller\">\n<div class=\"ace_content\">\n<div class=\"ace_layer ace_text-layer\">\n<pre class=\"ace_line\">certutil \u2013setreg ca\\CRLFlags +CRLF_REVCHECK_IGNORE_OFFLINE<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<p>Run this from an elevated command prompt and you should now be able to start the CA and get on with the business of troubleshooting.<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/xQug7us.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/i.imgur.com\/xQug7us.png\" alt=\"\" width=\"987\" height=\"510\" \/><\/a><\/p>\n<p>Perfect, now lets fix this!<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"The_Cause\"><\/span>The Cause<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>My CRL was online as it is available in Active Directory (for domain joined machines) and via HTTP at subca.zewwy.ca, an alias of the subordinate CA. I\u2019ve tested that I can retrieve the CRL by putting the HTTP path into a browser and I\u2019m prompted to download a file.<\/p>\n<div class=\"mivhak-code-wrapper\">\n<div class=\"ace_scroller\">\n<div class=\"ace_content\">\n<div class=\"ace_layer ace_text-layer\"><\/div>\n<\/div>\n<\/div>\n<div>\n<div><a href=\"https:\/\/i.imgur.com\/pOnQZaS.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" src=\"https:\/\/i.imgur.com\/pOnQZaS.png\" alt=\"\" width=\"997\" height=\"701\" \/><\/a><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<p>Through having spent some time recently with setting up an Enterprise PKI in my lab and for a project, I\u2019ve come to know the command line tool <a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/cc732443(v=ws.11).aspx\">certutil.exe<\/a>. This tool is available in all versions of Windows and should be the first tool to use to troubleshoot and manage certificates and certificate authorities on Windows.<\/p>\n<p>Certutil can be used to perform many functions, one of which is to verify a CRL. I know the path to the CRL file because I can view the CRLs on the file system (in C:\\Windows\\System32\\certsrv\\CertEnroll) and I\u2019ve <a href=\"http:\/\/zewwy.ca\/index.php\/2018\/03\/01\/setup-off-line-root-ca-part-1\/\">previously configured CRLs for both CAs<\/a>.<\/p>\n<p>To verify the CRL, use the -URL switch with the HTTP (or LDAP) path to the CRL:<\/p>\n<div class=\"mivhak-code-wrapper\">\n<div class=\"ace_scroller\">\n<div class=\"ace_content\">\n<div class=\"ace_layer ace_text-layer\">\n<pre class=\"ace_line\">certutil -URL \"http:\/\/subca.zewwy.ca\/CertEnroll\/OFFLINE-ROOT-CA.crl\"<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>This will display the <strong>URL Retrieval Tool<\/strong> that shows that the CRLs are able to be contacted and show a status of OK.<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/PXgtijM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/PXgtijM.png\" alt=\"\" width=\"1024\" height=\"649\" \/><\/a><\/p>\n<p>*NOTE* I discovered this works directly on the Windows Core Server, if you happened to be running Core (I do as I love optimization, specially when you have to work in lab environments). Except as you might have noticed from the screenshot, the radio buttons are all messed (wonder what library handles that, that wasn&#8217;t in core&#8230;)<\/p>\n<p>However, if we load a target certificate, in this case, the subordinate CA\u2019s cert, we can start to see why we have an issue with the CRL.<\/p>\n<p>Select the certificate for the subordinate CA that has been previously exported to the file system (in C:\\Windows\\System32\\certsrv\\CertEnroll) \u2013 click Select, open the certificate and click Retrieve again. This time, we can see a new line that shows that the base CRL for the subordinate CA\u2019s certificate is Expired. (Unfortunetly I had to simply use his source images as in my case I had to also correct my CDP locations on my sign Sub CA Certificate as I had mentioned in my initial Setup Offline Root CA blog post, but I guess I didn&#8217;t do it in my lab, so I sort of had to fix to birds with one stone, the CPD locations in my cert by reissuing that, and the offline root ca CRL file, so my additional steps were a bit beyond these exact steps, I also didn&#8217;t take snapshots as I wanted to get back on pace with my blog post)<\/p>\n<p><a href=\"https:\/\/stealthpuppy.com\/media\/2016\/09\/IssuingCAExpiredBaseCRL.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/stealthpuppy.com\/media\/2016\/09\/IssuingCAExpiredBaseCRL.png\" alt=\"\" width=\"837\" height=\"507\" \/><\/a><\/p>\n<p>The CRL for the subordinate CA\u2019s certificate will come from the root CA, so we\u2019ll need to check that CRL. Open the CRL file (<em>C:\\windows\\system32\\certsrv\\CertEnroll\\stealthpuppy Offline Root CA.crl<\/em>) \u2013 double-click or right-click and <strong>Open<\/strong>. Here we can see the CRL information, including the next publishing time (Next CRL Publish).<\/p>\n<div id=\"attachment_5147\" class=\"wp-caption aligncenter\">\n<p class=\"wp-caption-text\"><a href=\"https:\/\/stealthpuppy.com\/media\/2016\/09\/OfflineRootCA-CRL.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/stealthpuppy.com\/media\/2016\/09\/OfflineRootCA-CRL.png\" alt=\"\" width=\"419\" height=\"518\" \/><\/a><\/p>\n<\/div>\n<p>At the time of troubleshooting, this date was in the past and because the Root CA is offline and the CRL is hosted on a different server (the subordinate CA), this particular CRL will never receive an update. So, when the subordinate CA has rebooted, it has checked the Root CA\u2019s CRL and found it expired. Hence the certification authority service won\u2019t start.<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"How_To_Fix_It\"><\/span>How To Fix It<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Now we know why the certification authority service won\u2019t start and an understanding of why the CRL is offline, even if the wording doesn\u2019t match the symptoms. If the error message had told me the CRL had expired instead of being offline, I might have saved some troubleshooting time. We now know that we need to re-publish the CRL from the Root CA.<\/p>\n<p>Start the offline Root CA, log into it and open the <strong>Certification Authority<\/strong> console. We will first want to ensure that the CRL publication interval is extended so that we don\u2019t run into the same problem in the near future. Open the properties of the <strong>Revoked Certificates<\/strong> node to view and set the publication interval. The default interval is 1 week, obviously too often for an offline Root CA.<\/p>\n<p>Instead, set this value to something suitable for the environment you have installed the CA into. Remember that you\u2019ll need to boot the Root CA and publish a new CRL before the end of this interval, otherwise, you\u2019ll have exactly the same issue.<\/p>\n<div id=\"attachment_5137\" class=\"wp-caption aligncenter\">\n<p class=\"wp-caption-text\">\n<\/div>\n<p>Now publish a new CRL \u2013 right-click the <strong>Revoked Certificates<\/strong> node and click <strong>All Tasks<\/strong> \/<strong>Publish<\/strong>.<\/p>\n<div id=\"attachment_5149\" class=\"wp-caption aligncenter\">\n<p class=\"wp-caption-text\">\n<\/div>\n<p>Copy the updated CRL (from <em>C:\\Windows\\System32\\certsrv\\CertEnroll<\/em> by default) from the Root CA to the CRL distribution point and overwrite the existing CRL file (<em>C:\\Windows\\System32\\certsrv\\CertEnroll<\/em> again on my subordinate CA).<\/p>\n<p>Now if we again use certutil.exe to verify the CRL, it comes up roses:<\/p>\n<div id=\"attachment_5150\" class=\"wp-caption alignnone\">\n<p class=\"wp-caption-text\">\n<\/div>\n<p>To ensure that the subordinate CA\u2019s certification authority service will start, re-enable CRL checking:<\/p>\n<div class=\"mivhak-code-wrapper\">\n<div class=\"ace_scroller\">\n<div class=\"ace_content\">\n<div class=\"ace_layer ace_text-layer\">\n<pre class=\"ace_line\">certutil \u2013setreg ca\\CRLFlags -CRLF_REVCHECK_IGNORE_OFFLINE<\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<p>If you have re-published the CRL from the Root CA correctly, the service should start and you can then shut down the Root CA. Then open Outlook and put a reminder in the calendar for a week before the CRL expires again.<\/p>\n<h1 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>I\u2019ve had this issue with an Offline CRL a few times now and not really understood what the issue is until I took the time to troubleshoot the issue properly. I don\u2019t spend that much time with an enterprise PKI and it\u2019s easy to underestimate the complexity of setting up AD Certificate Services correctly.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Downed CA! First off I wanted to address that this wasn&#8217;t the intended post of today, this was suppose to be part 2 of the Global Protect post, which is the second dependency; Certificates. However I recently had to get a new cert at work, and discovered this same issue as I had deployed my &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/zewwy.ca\/index.php\/2018\/11\/04\/resolving-a-down-ca\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Resolving a down CA&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","footnotes":""},"categories":[4,8],"tags":[18,17],"class_list":["post-449","post","type-post","status-publish","format-standard","hentry","category-infosec","category-server-administration","tag-certificates","tag-pki"],"_links":{"self":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/449","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/comments?post=449"}],"version-history":[{"count":4,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/449\/revisions"}],"predecessor-version":[{"id":661,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/449\/revisions\/661"}],"wp:attachment":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/media?parent=449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/categories?post=449"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/tags?post=449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}