Does renewing SSL certificate require re-issuing the cert? - security

I have an SSL certificate that I am using to secure port 443 (HTTPS) on my nginx server running on Ubuntu for about 10 months now.
When I bought the cert, I got it for one year, so I have about 2 more months with this certificate.
My question is: "When I renew this cert, Will I just need to pay for renewal? or will I have to re-issue the cert with a new CSR, and have a potential downtime while installing?
I need to plan for any downtime from now.
Thanks in advance for your answers.

It's not possible to extend the expiration of an existing certificate once issued. The only way is to issue a new certificate.
Most certificate authorities offers a "renewal" concept, which provides some advantages compared to a new purchase. For example, you can renew in advance to the certificate expiration, and they will issue the new certificate from the expiration of the previous one, and not from the day the new one is issued.
The re-issue or re-key is a different thing. It generally means re-keying an existing certificate order with a different private key and/or CSR. It generally doesn't change the expiration of the certificate, hence it's not a renewal. Both renews and rekeys result in a new certificate (again, it's not possible to change an existing certificate once issued), but the rekey only alters the certificate information and not the expiration.
A renewal can be issued with the same original CSR and key, or with a completely new one. It's up to you.
As in all cases a new certificate is issued, you will have to replace the existing one. Replacing a certificate is generally a no-downtime task. You simply upload the new one, change the server settings and reload them (or restart the server).
Most webservers including Nginx supports hot reloads, therefore you don't need to restart the server and wait for it to reboot.
If planned correctly, the renewal will be a no downtime task.

To get the new one you might or might not need to submit a new CSR, depending on the CA. But in any case you get a new certificate file and need to replace the existing certificate on your server with a new one. See also
https://www.digicert.com/ssl-certificate-renewal.htm

Renewal of SSL certificate keeps security on your website alive along with your verified identity. The lapse in renewal can cause a warning on your website and warns your customers to move away from your site.
It depends on the SSL provider that you should continue with old CSR or generate new CSR, but it is recommended to create a new one to get rid of misconfiguration. However, it is a myth that your server will face downtime in the renewal of SSL certificate.
Certificate renewal and re-issuance both are different terms. Certificate renewal happens after the expiry of a certificate, while certificate re-issuance in the case of lost of a private key, want to change the domain/organization name or add new SAN names.
Most certificate providers are sending renewal reminder email frequently before certificate expiry. So, It is advisable to renew your certificate earlier, you can take advantage of getting additional validity period from early renewals.
This article may help you to understand the certificate renewal process. https://www.ssl2buy.com/wiki/how-to-renew-ssl-certificate/

Shortly to answer, no renewing SSL Certificate does not require re-issuing the cert, simply because reissue and renewal are 2 different actions with SSL certificate.
As you explained your situation, you are left with 2 months with your existing certificate and after that it will expire, so a Renewal is required. A Reissue (Revoke & Replace) is quite different, in that you cancel your current, valid SSL/TLS Certificate due to any of the reason and request for a new one.
Reissue:
Reissue of Certificates is the process where certificate has to be regenerated with Certificate Authority if needed. For example, if you have lost your Private Key. For that CA views the details of your certificate from list of certificates they have and then reissue the Certificate.
Furthermore, the process is quite same like in similar way activation will take place, like pasting of CSR for same domain name, selecting & approving of email. Reissuing of certificate change its Certificate ID & a new certificate record is also added into the account.
Renewal:
On the other hand renewal of certificate may seems pretty much same as purchasing new certificate, but it’s different. Renewal functionality is fully integrated within the module. If the settings of "Payment Type" is set to "Recurring" while creating a product, invoices for renewals will be generated automatically. Once paid, renewal of SSL certificates will be created automatically as well. Though one thing to note is that, after the renewal of SSL still activation is required through CSR.
Now one important thing is that, if you renew it before actual expiry date, like in your situation before 2 months, your new certificate will have expiration date one (or several, if you choose to be more than one year duration) year from the expiration date of the initial SSL certificate, so you will not lose any time on it.

Related

Pending Issuance - Azure SSL App Service Certificate

I have a Azure Web App that has a SSL Certificate. This certificate is set to auto-renew.
However it has stopped working. When I log on to the Azure portal, it says "perform required domain verification" and the status of the Certificate says "Pending Issuance". The expiry date is yesterday, so I guess it has expired.
But....
Why didn't it auto-renew?
Why is it telling me to verify the domain again? (I did this when I bought it 2 years ago)
I looked at the steps in the portal to verify the domain by updating the txt record in my DNS.
Done that.
It's been like an hour and it still doesn't work.
Do I need to just wait?
Can anyone explain whats going on here?
Glad you got it working.Just to highlight on renewal of certificate.
As mentioned in this doc "Beginning September 23 2021, App Service certificates require domain verification during renew or rekey if you haven't verified domain in the last 395 days. The new certificate order remains in "pending issuance" during renew or rekey until you complete the domain verification.
Unlike App Service Managed Certificate, domain re-verification for App Service certificates is not automated, and failure to verify domain ownership will result in failed renewals. Refer to verify domain ownership for more information on how to verify your App Service certificate."
If you are going to renew/rekey your certificate, and it's been > 395 days since you last verified domain ownership, you would be required do verify domain ownership again in order to have the new certificate be issued to you. If it's been < 395 days, your certificate will be automatically issued again without additional action needed from you. Similar discussion here.
In the end what I did was delete the current Certficate and create a new one. - That got the site back up and running without waiting around.

when purchasing an SSL certificate, does it automatically come with a root and intermediate?

I have done extensive research on this topic and my knowledge is still pretty ambiguous. I'm looking to get a basic DV for a simple site, but I see every SSL online has three levels, Root->Intermidiate (that acts as a proxy for the Root ) and a regular certificate i guess?
Here is Googles:
I see their Root is issued from GeoTrust but their intermediate is one of their own, so do you purchase the root separately or does it come with the purchase of an SSL? and Does the root create the intermediate thus signing the purchased SSL or? Some clarity would be nice..
It is very simple, when you order SSL certificate from vendor or Certificate Authority. CA will provide a zip file that contains root, intermediate and primary certificate. The reason behind to install root certificate is to avoid the browser warnings generally occurred while visiting website. You don’t need to order above mentioned certificate individually as it comes altogether.
The reason behind intermediate certificate is to create a chain of trust between browser of visitors and the web server. All three certificates should be copy and paste in a simple text file (check below example) and to be placed on server that will be used while installing the SSL later on. Hope this will clear your doubts.
Example:
—–BEGIN CERTIFICATE—–
(Primary certificate: yourdomain.crt)
—–END CERTIFICATE—–
—–BEGIN CERTIFICATE—–
(Intermediate certificate: ca.crt)
—–END CERTIFICATE—–
—–BEGIN CERTIFICATE—–
(Root certificate: root.crt)
—–END CERTIFICATE—–
A certificate serves two purposes:
Encrypt connection
Prove that the site owner is who claims to be
If we were just going to encrypt data any certificate would do (even a self-signed) but that's not enough in real life because we also need to ensure that we aren't connecting to a fake site (there's no point in keeping information secure and then deliver it to the bad guys) and that's where the trust chain concept comes in. In your example:
You have a certificate for www.google.com, but you can't really say whether it's genuine. After all, anyone can generate a cert for www.google.com.
Someone who claims to be Google guarantees that the above certificate is genuine, but you can't really say whether they are the real Google.
Someone who claims to be GeoTrust guarantees that the above certificate has been really issued to the real Google. But this time you trust GeoTrust because it is configured as root authority in your browser. Either it comes with the browser (and you trust your browser) or you installed the CA yourself (that's typical in Spain when you need to access government sites).
It's also worth noting that we could have an arbitrary number of levels, not necessarily three.
To sum up:
You don't own any certificate in the trust chain except the last one you've paid for.
The company you get the cert from should have already done all the paperwork to be part of the bundled CAs in major browsers (after all, they charge for the service). Otherwise, your site visitors will get an untrusted certificate error message because they won't have the root CA.
Optionally, you might need to download and install some additional intermediate certificates (but you still don't own them).

How Do I Create a Production Client Authentication Certificate for Azure Key Vault?

I am learning about Azure Key Vault, and one of the scenarios it supports is certificate authentication, which you can read about here.
The samples do a great job of explaining how to make a self-signed certificate for local testing, which I have gotten to work without an issue. My question now is, how do I go about making a certificate for production deployments? Do I purchase this from a service somewhere? If so, what type of certificate do I need, exactly?
Unfortunately, there is no documentation anywhere that I could find in Azure Key Vault that outlines how to make (or what is expected/assumed) in a production-level certificate.
I basically have a few requirements/expectations based on my research/investigation so far:
I would like to use a trusted, external service (CA?) to purchase the certificate from.
The cheaper the certificate the better. :)
I would like to be able to create a certificate with custom data extensions.
In addition to my requirements, I have a specific question in regards to the certificate: What type of certificate do I need? Is this a server authentication certificate? Or a client authentication certificate? Or... ?
I have spent the past hour going through several SSL certificate providers, but none of them really could give me a great answer for the type of certificate I am looking for (when I provided the link to Azure certificate above to them). So, I decided to do what I should have done in the first place, and put my question up here to the esteemed community. :)
Thanks in advance for any assistance.
If you want the cert for SSL you want to get a Server Authentication certificate (it proves that the server, ie your site, is who it claims to be).
You can buy it from any trusted service and upload it to Azure Key Vault. Just google "buy ssl certificate". I think you can get one for as little as $30 if I remember correctly.
You can use Key Vault to enroll for certificate from public CAs such as DigiCert and GlobalSign. Look at the "Enroll programmatically from Public CA" section in https://blogs.technet.microsoft.com/kv/2016/09/26/get-started-with-azure-key-vault-certificates/
You can use the Key Vault REST API to programmatically enroll for certificates -https://learn.microsoft.com/en-us/rest/api/keyvault/createcertificate
The certificate policy allows for some customization like specifying which KeyUsage and EKUs you want in your certificate.

Is there a way to form secure connections without trusted third parties?

I've just recently learned a bit about how encrypted messages are sent across the Internet, and it seems that it relies a lot on "trusted third parties" My problem is that I don't trust anyone, is there some way to form an encrypted connection between two computers without prior secrets or the need to trust anyone?
Yes, by creating a "Certificate Authority" (CA) and installing its certificates on the machines.
The third parties you're talking about issue certificates, and sign those certificates using a CA certificate that is included in popular operating systems and/or web browsers. You can create your own CA certificate and install it onto the machines in question alongside those third party certificates. Then you can issue your own SSL certificates which will be recognised by those machines without any third party involvement.
Note that the CA certificates aren't "prior secrets" - there's nothing secret about the certificate itself. It has a private key, which you use to sign your SSL certificates, but that key doesn't need to be on the machines in question (and shouldn't be).
There are plenty of sites that will walk you through the process - a quick Google turned up this one for example: Creating Your Own SSL Certificate Authority.

Which parts of the client certificate to use when uniquely identifying users?

I'm designing a system where users will be able to register and afterward authenticate with client certificates in addition to username/password authentication.
The client certificates will have to be valid certificates issued by a configured list of certificate authorities and will be checked (validated) when presented.
In the registration phase, I need to store part(s) of the client certificate in a user repository (DB, LDAP, whatever) so that I can map the user who authenticates with client certificate to an internal "user".
One fairly obvious choice would be to use certificate fingerprint; But fingerprint itself is not enough, since collisions may occur (even though they're not probable), so we need to store additional information from the certificate. This SO question is also informative in this regard.
RFC 2459 defines (4.1.2.2) that certificate serial number must be unique within a given CA.
With all of this combined, I'm thinking of storing certificate serial number and certificate issuer for each registered user. Given that client certificates will be verified and valid, this should uniquely identify each client certificate. That way, even when client certificate is renewed, it would still be valid (serial number stays the same, and so does the issuer).
Did I miss something?
You have several solutions:
Storing a fingerprint.
Yes you are right, a collision is theoretically possible but the probability is really really low and you can consider it does not happen : 2 users in your system will not have accidentally the same certificate fingerprint. However hash algorithms are getting weaker over time and an attacker may try to forge a certificate whose fingerprint matches a registered one. This attack is called second preimage attack and is pretty hard to do since the attacker does not try to forge some random data matching the fingerprint but a real X.509 certificate which can pass the initial validation phase (i.e. hacking the PKI). Pretty hard :) But if you really want to prevent yourself against collision you can store 2 fingerprints with 2 distinct algorithms (e.g. SHA-1 and SHA-256).
Storing the certificate issuer and serial number. Yes it can be used as a unique certificate identifier. As you wrote, the standard (RFC 5280 obsoletes RFC 2459) indicates [The serial number] MUST be unique for each certificate issued by a given CA. However it also means that when the certificate is renewed the serial number changes since a new certificate is issued by the CA.
A final remark: you want to handle certificate renewal and it is a good idea, a lot of software editor forget that certificates have to be renewed. But you must be aware that almost everything may change in the certificate: the subjet name (people may change their name, women get married...), the issuer name (the certificate supplier company may change...), the key algorithm, the key size, the extensions... In your system the certificate renewal process will probably be pretty close to the initial user certificate registration.
The best way to uniquely identify a user is by email address. In the registration process a valid email address must be mandatory. Then you associate the certificate serial number and issuer or perhaps a hash of the the certificate itself with the email and the user id. Then, when the certificate expires or the user changes the certificate he/she will have a "renew certificate link" where he enters the email address and he receives a link to upload the new certificate. You can then replace the old serial/issuer with the new one.
I decided to concatenate the issuer name, a delimiter |, and the DN.
Hopefully, this solves the problem of using serial numbers which change on renewal.

Resources