CipherString = DEFAULT@SECLEVEL=1 in openssl.cnf has no effect in a Docker image
CipherString = DEFAULT@SECLEVEL=1 in openssl.cnf makes no differenceShort 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.
Fix it fast
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"2Match what you see, then jump to its fix
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 32Fix
Put a colon between the items.
CipherString = DEFAULT:@SECLEVEL=13Verify
The second command above lists ciphers without an error.
openssl ciphers -s -v 'DEFAULT:@SECLEVEL=1' | head -n 3Confirmed by docs.openssl.org
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.cnf2Fix
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.cnf3Verify
Restart the application and repeat the failing TLS call.
echo $OPENSSL_CONFConfirmed by docs.openssl.org
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
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
sam local fails: Running AWS SAM projects locally requires Docker
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
sam local start-api and sam local invoke run your function inside a Docker container, so SAM stops if it cannot talk to Docker.
3 causes, each with a fixServers
dnf fails to download repo metadata in a CentOS 8 Docker build
The same Dockerfile built fine before 2022
CentOS Linux 8 reached end of life on 31 December 2021 and its content left the mirrors.
2 causes, each with a fixServers
pip install confluent-kafka fails because librdkafka/rdkafka.h is missing
pip stops while building confluent-kafka from source
The error means pip is compiling confluent-kafka from source, and the compiler cannot find the librdkafka C headers.
3 causes, each with a fixServers
Cypress says the npm package is installed but the binary is missing
Cypress binary is missing after npm install in CI or in a Docker build
The npm package is only a launcher.
3 causes, each with a fixServers
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