# nginx: [emerg] SSL_CTX_set_cipher_list("...") failed — invalid ssl_ciphers string

**Code:** `ssl_ciphers` · **Category:** SSL / TLS · **Seen on:** Nginx, SSL, OpenSSL

The `ssl_ciphers` value contains a cipher or syntax OpenSSL doesn't accept, so nginx won't load the config.

## Meaning

Use a valid OpenSSL cipher string (check with `openssl ciphers -v 'STRING'`), avoid copy-pasting TLS 1.3 suite names into `ssl_ciphers` (TLS 1.3 suites are configured separately), and remove ciphers removed in OpenSSL 3. Use Mozilla's SSL Configuration Generator as a baseline.

## Common causes

- Typos or unknown cipher names
- TLS 1.3 suite names in ssl_ciphers
- Cipher removed in the OpenSSL build
- Stray whitespace/newlines in the value
- Config copied from an old guide

## Quick fix

1. Validate: `openssl ciphers -v "ECDHE+AESGCM"`
2. Use a Mozilla-recommended list
3. Run `nginx -t` after each change

## Detailed fix by platform

### Nginx

1. 

```nginx
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
```


## How to diagnose

1. **Cipher string** — Valid?
2. **TLS 1.3** — Separate?
3. **Syntax** — Clean?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/ssl/nginx-ssl-ciphers-bad-cipher-string)
