Change OpenSSL Default Signature Algorithm

In a previous post I mentioned how Google & Microsoft are starting to deprecate the use of SHA-1 Certificate Signatures in their browsers.

Google’s announcement can be found here at

Following on from this post I wondered how to change the default settings of OpenSSL to make sure that all future certificates don’t use SHA-1.

OpenSSL on Ubuntu 12.04 / 14.04

First edit the OpenSSL config file

$ sudo vim /etc/ssl openssl.cnf

Look for the following section

[ CA_default ]   

default_days    = 1000          # how long to certify for
default_crl_days= 30            # how long before next CRL
default_md  = default        # use public key default MD
preserve    = no            # keep passed DN ordering

Make the following change and save the file.

default_md  = sha256        # use SHA-256 for Signatures

From this point onwards all Certificates generated will be signed with SHA-256.

Check the Certificate Signature

The following command will output information about the Certificate

$ openssl x509 -in cert.crt -text -noout

The output should look something like this.

        Version: 3 (0x2)
        Serial Number: 11485830970703032316 (0x9f65de69ceef2ffc)
    Signature Algorithm: sha256WithRSAEncryption
        Issuer: C=US, ST=MD, L=Baltimore, CN=Test CA/
            Not Before: Jan 24 14:24:11 2014 GMT
            Not After : Feb 23 14:24:11 2014 GMT
        Subject: C=US, ST=MD, L=Baltimore, CN=Test CA/
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (4096 bit)
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Subject Key Identifier: 
            X509v3 Authority Key Identifier: 

            X509v3 Basic Constraints: critical
            X509v3 Key Usage: 
                Certificate Sign, CRL Sign
    Signature Algorithm: sha256WithRSAEncryption

 Hopefully in the not too distant future this will become the default on new installs. It may also be changed with a security update.


One comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s