Firefox 54 Stopped Trusting Self-Signed Certs

前端 未结 4 1598
醉酒成梦
醉酒成梦 2021-01-31 10:11

With the recent upgrade of Firefox 54, my self-signed localhost SSL certificate stopped being trusted.

I\'ve been using a Firefox AutoConfigure script to in

4条回答
  •  耶瑟儿~
    2021-01-31 10:38

    To mimic the CA-chain requirements mandated by Firefox 54, the following is required:

    1. Keypair marked as a Root-CA, capable of generating an SSL certificate.
    2. Second keypair marked for SSL which obtains a chained certificate from Root-CA

    To illustrate how this is done with Java keytool including the steps to create private keystores:

    # Create a Root-CA private keystore capable of issuing SSL certificates
    keytool -genkeypair -noprompt -alias my-ca -keyalg RSA -keysize 2048 -dname CN=localhost -validity 3650 -keystore .\my-ca.jks -storepass pass77 -keypass pass77 -ext ku:critical=cRLSign,keyCertSign -ext bc:critical=ca:true,pathlen:1
    
    # Export the Root-CA certificate, to be used in the final SSL chain
    keytool -exportcert -alias my-ca -keystore .\my-ca.jks -storepass pass77 -keypass pass77 -file .\my-ca.crt -rfc -ext ku:critical=cRLSign,keyCertSign -ext bc:critical=ca:true,pathlen:1
    
    # Create a container SSL private keystore (external localhost.foo.bar dns entry optional:IE11 domain intranet policy)
    keytool -genkeypair -noprompt -alias my-ssl -keyalg RSA -keysize 2048 -dname CN=localhost -validity 3650 -keystore .\my-ssl.jks -storepass pass77 -keypass pass77 -ext ku:critical=digitalSignature,keyEncipherment -ext eku=serverAuth,clientAuth -ext san=dns:localhost,dns:localhost.foo.bar -ext bc:critical=ca:false
    
    # Create a certificate signing request (CSR) from our SSL private keystore
    keytool -certreq -keyalg RSA -alias my-ssl -file .\my-ssl.csr -keystore .\my-ssl.jks -keypass pass77 -storepass pass77
    
    # Issue an SSL certificate from the Root-CA private keystore in response to the request (external localhost.foo.bar dns entry optional)
    keytool -keypass pass77 -storepass pass77 -validity 3650 -keystore .\my-ca.jks -gencert -alias my-ca -infile .\my-ssl.csr -ext ku:critical=digitalSignature,keyEncipherment -ext eku=serverAuth,clientAuth -ext san=dns:localhost,dns:localhost.foo.bar -ext bc:critical=ca:false -rfc -outfile .\my-ssl.crt
    
    # Import Root-CA certificate into SSL private keystore
    keytool  -noprompt -import -trustcacerts -alias my-ca -file my-ca.crt -keystore my-ssl.jks -keypass pass77 -storepass pass77
    
    # Import an SSL (chained) certificate into keystore
    keytool -import -trustcacerts -alias my-ssl -file my-ssl.crt -keystore my-ssl.jks -keypass pass77 -storepass pass77 -noprompt
    

    Once this is done, only the Root-CA certificate needs to be trusted by Firefox, and can be imported using the GUI or via AutoConfig script.

    The SSL server must be restarted using the new SSL private keystore, which will contain the chain of trust to work via SSL.

    Since my-ssl.jks contains the entire chain of trust my-ca.jks, my-ca.crt, my-ssl.crt and my-ssl.csr can all safely be deleted (assuming my-ca.crt has been imported properly)

提交回复
热议问题