Uploaded image for project: 'TrueNAS'
  1. TrueNAS
  2. NAS-106567

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



    • Type: Bug
    • Status: Done (View Workflow)
    • Priority: Low
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 11.3-U4
    • Component/s: Certificates
    • Labels:
    • Impact:


      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







                waqar Waqar Ahmed
                hjd H .
                Bug Clerk, H ., Sean McBride, Waqar Ahmed
                1 Vote for this issue
                4 Start watching this issue