OCSP service under IIS throws HTTP 500 error, Root Agency Cert bit length defaults to 512

Anonymous
2024-02-14T17:05:58+00:00

This is only the third time in 25 years that I’ve done this so I’m no seasoned professional when it comes the RSA and PKI. I’ve started, backed up, and restarted four times and can’t get past one point in the process. I’m stuck at configuring the OCSP service under IIS.

The OCSP service can’t respond and it’s been difficult tracking down possible causes. After creating custom event views for the PKI components, I found event log warnings for:

CertificationAuthority Event ID: 93

The certificate (#0) of Active Directory Certificate Services My-Enterprise-CA does not exist in the certificate store at CN=NTAuthCertificates,CN=Public Key Services,CN=Services in the Active Directory's configuration container. The directory replication may not be completed.

CertificationAuthority Event ID: 103

Active Directory Certificate Services added the root certificate of certificate chain 0 to the downloaded Trusted Root Certification Authorities Enterprise store on the CA computer. This store will be updated from the Certification Authorities container in Active Directory the next time Group Policy is applied. To verify that the CA certificate is published correctly in Active Directory, run the following command: certutil -viewstore "ldap:///CN=My-Enterprise-CA,CN=Certification Authorities,CN=Public Key Services,CN=Services,CN=Configuration,DC=corp,DC=mydomain,DC=com?cACertificate?base?objectClass=certification Authority" (you must include the quotation marks when you run this command). If the root CA certificate is not present, use the Certificates console on the root CA computer to export the certificate to a file, and then run the following command to publish it to Active Directory: Certutil -dspublish %certificatefilename% Root.

The command suggested in the Event ID 103 Warning, fails with the message:

CertUtil: -viewstore command FAILED: 0x80070002 (WIN32: 2 ERROR_FILE_NOT_FOUND)

CertUtil: The system cannot find the file specified.

Further investigation of this led to discovering that the “Root Agency” certificate bit length was only 512, and the suggestion of recreating the certificate with a minimum of 1024 bits. But I want to confirm this before doing so to ensure there’s something I haven’t missed in coming to this conclusion. There may in fact be more than one cause here.

The PKI "CAPolicy.inf" file I setup calls for a bit length of 4096, but there is nothing in that file to address the issue of a minimal bit length for RSA of 1024, and I have found nothing in my reading that suggested this as well. Why it defaults to 512 bits I can’t say, I have assumed since Windows requires a minimum bit length of 1024, that this would have been the default OOBE for AD CA services. The fact that I have started, backed up and restarted four times, may have introduced elements affecting the current outcome, so where to go from here eludes me.

More Background:

I’m installing and configuring a Windows Certificate PKI for my development and learning domain. My approach has been as follows:

  1. Setup a non-domain joined, offline Windows 2019 Server as the Root-CA, hardened to prevent access from non-administrative types. This machine issues the Root-CA and the Subordinate Enterprise-CA hosted on another domain joined server.
  2. Setup an Enterprise-CA on a domain joined Windows 2019 Server to host the Enterprise-CA and the PKI for my local domain.
  3. On the Enterprise-CA install the Certificate Authority, Certificate Authority Web Enrollment, Online Responder, and IIS services.
  4. At the point where I launch the Certificate Authority snap in and configure the location for the OCSP responder using a URL such as http://ocsp.corp.mydomain.com/ocsp it fails, I have confirmed DNS settings are correct and functional. Yet, IIS returns a 500 error.
  5. Investigating that, led to an error message about not being able to locate a CRL, and that led to the error of the Root Agency certificate bit length being less than 1024. I’m hoping the fix is as simple as re-issuing a Root Agency certificate with bit length of 2048, but when it comes to PKI, nothing so far has been simple, so I want to run these issues by some experts who can help me keep from blowing up my lab environment any further.

Thanks,

Windows for business | Windows Server | Directory services | Certificates and public key infrastructure (PKI)

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2024-02-15T06:29:15+00:00

    Hello Carter9304,

    Thank you for posting in Microsoft Community forum.

    1.Based on the information below:

    CertificationAuthority Event ID: 93

    The certificate (#0) of Active Directory Certificate Services My-Enterprise-CA does not exist in the certificate store at CN=NTAuthCertificates,CN=Public Key Services,CN=Services in the Active Directory's configuration container. The directory replication may not be completed.

    You can check if you have CN=NTAuthCertificates in CN=Public Key Services container as below.

    1. For CertificationAuthority Event ID: 103, you can open certlm.msc console on CA server and check if the root CA certificate is in trusted root certification authorities container?

    If no, you can publish root certificate to domain by running command:

    certutil -f -dspublish <the full path of the rootCA.cer> RootCA

    For example:

    RootCA.cer is the root CA certificate file name and rootCA is the CA name.

    3.You can check the Publish Key bit on root CA and issuing CA(it is 4096 bits below).

    4.For configuring OCSP, you can check the steps in the following link.

    Implementing an OCSP responder: Part III - Configuring OCSP for use with Enterprise CAs - Microsoft Community Hub

    5.To check the health of PKI, you can open PKIview.msc console and check if all the entries are OK.

    I hope the information above is helpful.

    If you have any question or concern, please feel free to let us know.

    Best Regards,
    Daisy Zhou

    0 comments No comments
  2. Anonymous
    2024-05-01T03:49:08+00:00

    Hi Carter! You wrote "After creating custom event views for the PKI components", and I was wondering how you did this? Would you be able to share the XML of the custom view, or even just the folder you were looking in, please?

    2 people found this answer helpful.
    0 comments No comments