Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

CipherString = DEFAULT@SECLEVEL=1 in openssl.cnf has no effect in a Docker image

ErrorCipherString = DEFAULT@SECLEVEL=1 in openssl.cnf makes no difference

Short answer

Two things break this. The cipher string needs a separator, so write DEFAULT:@SECLEVEL=1, not DEFAULT@SECLEVEL=1. The line must sit in a section that the main section reaches, and the file must be the one OpenSSL reads, set with OPENSSL_CONF.

  • Applies to OpenSSL 3.0, Debian 12 or Ubuntu 24.04 base images
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Ask OpenSSL what level it actually applies to a cipher string, without touching any config file.

    openssl ciphers -s -v 'DEFAULT:@SECLEVEL=1' | head
    echo "OPENSSL_CONF=$OPENSSL_CONF"
  2. 2Match what you see, then jump to its fix

    1. 1The line reads DEFAULT@SECLEVEL=1No separator between DEFAULT and @SECLEVELFix
    2. 2The cipher line is correct, but nothing changes in the applicationThe config section is never reached, or the file is not the one in useFix

What does the error look like?

  • CipherString = DEFAULT@SECLEVEL=1 in openssl.cnf makes no difference

Cause 1 of 2

No separator between DEFAULT and @SECLEVEL

1Check

Cipher strings are separated by colons (commas or spaces also work). @SECLEVEL=n can be used at any point in the string, as its own item, with n from 0 to 5.

openssl ciphers -s -v 'DEFAULT@SECLEVEL=1' | head -n 3
openssl ciphers -s -v 'DEFAULT:@SECLEVEL=1' | head -n 3

2Fix

Put a colon between the items.

CipherString = DEFAULT:@SECLEVEL=1

3Verify

The second command above lists ciphers without an error.

openssl ciphers -s -v 'DEFAULT:@SECLEVEL=1' | head -n 3

Confirmed by docs.openssl.org

Did this fix it?

Cause 2 of 2

The config section is never reached, or the file is not the one in use

1Check

OpenSSL starts from openssl_conf in the default section, which names a section; its ssl_conf entry names the list of SSL/TLS configurations, and a section called system_default applies whenever an SSL_CTX is created. A line outside this chain is not read. OPENSSL_CONF sets the file path and can be the empty string for none.

echo "$OPENSSL_CONF"
grep -n -E 'openssl_conf|ssl_conf|system_default|CipherString' /etc/ssl/openssl.cnf

2Fix

Make the chain complete and point OPENSSL_CONF at the file when you ship a custom one.

# top of the file, before any [section]
openssl_conf = openssl_init

[openssl_init]
ssl_conf = ssl_sect

[ssl_sect]
system_default = system_default_sect

[system_default_sect]
CipherString = DEFAULT:@SECLEVEL=1

# Dockerfile (use the path of the file your image actually has)
ENV OPENSSL_CONF=/etc/ssl/openssl.cnf

3Verify

Restart the application and repeat the failing TLS call.

echo $OPENSSL_CONF

Confirmed by docs.openssl.org

Did this fix it?

How do I stop it coming back?

  • Scope the weaker setting to one image or one process, not the whole base image.
  • Test the cipher string with openssl ciphers before it goes into the file.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Servers

A dev container port does not open in the browser when Docker runs on a remote host

If your application only accepts calls from localhost, it will reject connections from published ports

Three things usually break it: the app listens only on localhost inside the container, so published ports are rejected; you open the container port instead of the mapped localhost port VS Code shows; or you changed appPort or a Compose ports list and did not rebuild.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.