FreeNAS CA Unable to generate valid certificates for iOS 13 and Catalina and other browsers.

Description

Starting with macOS Catalina and iOS 13, Apple has begun placing new restrictions on how it treats certificates. You can get all the gory details here: https://support.apple.com/en-us/HT210176 .

In a nutshell it boils down to:

TLS server certificates and issuing CAs using RSA keys must use key sizes greater than or equal to 2048 bits. Certificates using RSA key sizes smaller than 2048 bits are no longer trusted for TLS.
TLS server certificates and issuing CAs must use a hash algorithm from the SHA-2 family in the signature algorithm. SHA-1 signed certificates are no longer trusted for TLS.
TLS server certificates must present the DNS name of the server in the Subject Alternative Name extension of the certificate. DNS names in the CommonName of a certificate are no longer trusted.

This is all pretty straightforward, and supported right now in FreeNAS when it comes to generating a certificate. You will need to remember to put in the DNS name of the server in question in the SAN field (and the IP address for good measure if you're extra careful like me!)...but as long as you're careful, it works.

Now here's the rub. There are two additional requirements beginning for certificates issued after July 1, 2019:

TLS server certificates must contain an ExtendedKeyUsage (EKU) extension containing the id-kp-serverAuth OID.
TLS server certificates must have a validity period of 825 days or fewer (as expressed in the NotBefore and NotAfter fields of the certificate).

The second requirement of 825 days is again different than the default of 3650 in the FreeNAS CA certificate generator, but as long as you remember to change the default when generating a new certificate, you're in good shape.

The first requirement is the problem, however. Certificates generated by FreeNAS don't seem to include the EKU extension, and that breaks things in Safari and (soon) other browsers.

To create a compliant certificate, you need to do something like (cribbed from this terrific summary of the issues presented in Catalina and iOS 13):

openssl x509 -passin pass:$CA_PASSWORD -req -days $CLIENT_VALID_DAYS -in $CSR_FILE -CA $CA_CRT_FILE -CAkey $CA_KEY_FILE \
-out $CRT_FILE -CAcreateserial -CAserial $CA_DIR/ca.seq -extfile <(printf "extendedKeyUsage = serverAuth \n subjectAltName=DNS:$SANS") > /dev/null

Problem/Justification

None

Impact

None

SmartDraw Connector

Katalon Manual Tests (BETA)

Activity

Show:

Bug Clerk 
June 29, 2020 at 4:37 PM

H . 
June 28, 2020 at 5:39 PM

Thanks!

Waqar 
June 28, 2020 at 1:48 PM

I think we should have it in 11.3-U4

H . 
June 28, 2020 at 1:02 PM

Great! Do you expect it to be ready for the next update?

Waqar 
June 28, 2020 at 12:33 PM

Hi , we decided it's best if for 11.3 we default to adding server EKU extension in certificates - so for now that should be good until 12 gives end users more advance control wrt deciding which extensions should they desire in their certs.

Complete

Details

Assignee

Reporter

Impact

Components

Fix versions

Priority

More fields

Katalon Platform

Created June 23, 2020 at 4:59 PM
Updated July 1, 2022 at 4:52 PM
Resolved June 29, 2020 at 4:37 PM