I created a self-signed root Certificate Authority for a few internal services in our company, which I configured myself (mostly served over HTTPS). Then I created certificates for those services, signed with this CA.

Now I want to add an x509 extension (CRL distribution point) to the root CA without invalidating existing server certificates issued from this CA. Is this possible?

My gut feel is "yes" because as I understand, access to the corresponding private key is necessary and sufficient for "full authority" over certificate identity. That is, unless there is some sort of nonce incorporated along with the public key into the certificate when it is generated (likely).

I'm still fairly new to SSL certificate management, but I (think I) understand the basics of the standard trust chain. I'm also comfortable with basic use of other PKI crypto: I manage SSH keys and use GPG for signing and encryption. I studied Computer Science, though I'm only a self-taught dabbler in cryptography.

I never made a CSR for the original IIRC (I think it was the direct output of openssl req -new -x509). I still have the original CA's private key, of course, and using it I was able to "reverse" the original cert into a Certificate Signing Request: openssl x509 -x509toreq -in MyCA.pem -out MyCA.csr -signkey private/MyCA.key

I was hoping this would effectively "extract" the nonce mentioned above, and allow me to recreate the certificate but this time with a crlDistributionPoints field, and consequently all certificates that were signed with the original CA would still validate against this new CA, with the exception that clients would retrieve my (currently empty) CRL file from the HTTP URL designated in the field.

So I made an extension config file ext.conf:

[ cert_ext ] 

And I generated the new version of the root CA from the CSR:

openssl x509 -extfile ./ext.conf -extensions cert_ext -req -signkey private/MyCA.key -in MyCA.csr -out MyNewCA.pem

Now when I view the certificate with openssl x509 -text -in MyNewCA.pem | less

I can see the CRL extension part:

X509v3 extensions:
    X509v3 Subject Key Identifier: 
    X509v3 CRL Distribution Points: 

        Full Name:

But alas! My previously signed certificates no longer validate against this one:

openssl verify -verbose -CAfile MyCA.pem git.pem 
git.pem: OK

openssl verify -verbose -CAfile MyNewCA.pem git.pem 
git.pem: <redacted DN>
error 20 at 0 depth lookup:unable to get local issuer certificate

Mostly I'm looking for more insight into how certificates work and why. But I'd also welcome a solution to the problem that lead to this one, so here's some background info too.

How I got into this mess: HTTPS to internal services work great once my CA is installed via the Explorer RMB → Install Certificate GUI on Windows, or the /usr/local/share/ca-certificates followed by update-ca-certificates on Debian and Ubuntu. But I recently ran into an exception: Git on Windows, specifically if installed to use Windows Secure Channel as SSL back-end. Which apparently by default insists that there must be a CRL field in SSL certificates.

So I guess it's really a Windows Secure Channel issue because the error message I keep running into seems entirely Microsoft-specific: fatal: unable to access 'https://[email protected]/gitblit/r/secret_project.git/': schannel: next InitializeSecurityContext failed: Unknown error (0x80092012) - The revocation function was unable to check revocation for the certificate.

If I install Git with OpenSSL and manually concatenate my CA onto the file pointed to by git.http.sslcainfo then it works, but I fear my users will be inclined to nope out on SSL identity verification if they feel this process is more effort than clicking through the "easy" Windows certificate installer GUI.

  • 1
    Only the public key and the Subject makes a certificate unique. Therefore, if you don't change either, you should be able to re-sign your certificate while altering all other fields and extensions to your heart's content. Commented Jul 13, 2017 at 13:07
  • @garethTheRed ah, that makes sense. I'm not sure how to do this; could you elaborate or post an answer with more details? I hoped that -x509toreq would recover all unique info from the existing root CA, but either it doesn't or there's something wrong with my process from there. Commented Jul 14, 2017 at 13:14
  • 1
    req -new -x509 and x509 -req -signkey both default the serial of the self-signed cert to a random number (although this can be overridden) effectively a nonce. If your child cert (or any of them) contains AuthorityKeyIdentifier using the 'issuer+serial' option (instead of or in addition to the 'keyid' option), which will be the case if you used ca with the upstream default config file, you need to create the new root with the same serial as the old one; use -set_serial. ... Commented Jul 15, 2017 at 11:40
  • ... But some sw may be unhappy if you try to import a new cert with the same name and serial as an existing one; you may need to clean out the old one first. Commented Jul 15, 2017 at 11:44
  • 1
    Near-cross-dupe security.stackexchange.com/questions/17331/… PS: I think it's possible to get Windows to manually cache the CRL for a CA in which case the lack of CRLDP might not matter, but how inconvenient that would be I don't know. Commented Jul 15, 2017 at 11:54

1 Answer 1


Two certificates are considered the same as long as the Subject Name and the Public Key of the certificates match.

Therefore, all you need to do is to re-use the keys and ensure that the Subject Name in the new certificate is the same as the old. After that, you can change any of the other fields and/or extensions and the resulting certificate will be considered the same.

For example, create your OpenSSL configuration file:

[ req ]

prompt             = no
string_mask        = default
distinguished_name = x509_distinguished_name
x509_extensions     = x509_ext

[ x509_distinguished_name ]

# Note that the following are in 'reverse order' to what you'd expect to see.
# Adjust for your setup:

countryName = za
organizationName = My Company
organizationalUnitName = Security
commonName = My Root CA

[ x509_ext ]

basicConstraints = critical,CA:true
keyUsage = critical, keyCertSign, cRLSign
subjectKeyIdentifier = hash
crlDistributionPoints = URI:http://security.mycompany.co.za/root.crl

and save it as e.g. rootca.cnf. Ensure that the elements of the [req_distinguished_name] are identical to the ones in your original Root CA certificate (this is the identical Subject Name part).

Next, run:

openssl req -new -x509 -key rootca.key -out MyNewCA.pem -config rootca.cnf

where rootca.key is the private key used in the original certificate (this is the identical Public/Private Key part).

This creates MyNewCA.pem, which you can check with:

$ openssl x509 -noout -text -in MyNewCA.pem

    Version: 3 (0x2)
    Serial Number: 17564687072266118846 (0xf3c24dd49d5166be)
Signature Algorithm: sha256WithRSAEncryption
    Issuer: C=za, O=My Company, OU=Security, CN=My Root CA
        Not Before: Jul 15 05:05:54 2017 GMT
        Not After : Aug 14 05:05:54 2017 GMT
    Subject: C=za, O=My Company, OU=Security, CN=My Root CA
    Subject Public Key Info:
        Public Key Algorithm: rsaEncryption
            Public-Key: (2048 bit)
            Exponent: 65537 (0x10001)
    X509v3 extensions:
        X509v3 Basic Constraints: critical
        X509v3 Key Usage: critical
            Certificate Sign, CRL Sign
        X509v3 Subject Key Identifier: 
        X509v3 CRL Distribution Points: 

            Full Name:

Signature Algorithm: sha256WithRSAEncryption

Use this new certificate in place of the original.

You can change other fields and extensions, such as the validity period of the certificate, but bear in mind that you shouldn't really have any constraints (other than basicConstraints = critical,CA:true) on the Root CA certificate.

After further consideration, your issue may simply be down to the fact that your replacement Root CA certificate doesn't have the basicConstraint and possibly the keyUsage extensions. It might be worth trying adding those two extensions to your ext.conf first and testing the resulting new Root CA certificate using the -x509toreq method you posted.

  • Thanks for the comprehensive answer, it has really helped me understand things better. With this and @dave_thompson_085's comments I've managed to regenerate my CA in a way that doesn't invalidate child certs. There were a few things wrong with my original attempt (I should probably post an answer with more detail?) Also thanks for that obvious-in-retrospect but important point that "Subject Name" is a field composed of those particular fields. I somehow doubt anyone else will post an answer, so I'm accepting this one. Commented Jul 17, 2017 at 9:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .