0
ctx = httpx.create_ssl_context()
ctx.set_ciphers("TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256:TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384:TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256:TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA:TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA:TLS_RSA_WITH_AES_128_GCM_SHA256:TLS_RSA_WITH_AES_256_GCM_SHA384:TLS_RSA_WITH_AES_128_CBC_SHA:TLS_RSA_WITH_AES_256_CBC_SHA")

That are the cipher suites I've got from my http debugger, but after running this it says

ssl.SSLError: ('No cipher can be selected.',)

I didn't even make a request so I think it's unsupported?

Thanks in advance

Sad Land
  • 23
  • 3

1 Answers1

0

You need to ensure that every single cipher name there use OpenSSL's naming for the ciphers.

There's a possibility one or more of the ciphers you used there are the "public" names, but OpenSSL has their own names for those ciphers.

Take a look at this for the mapping:

https://www.openssl.org/docs/man1.1.1/man1/ciphers.html

pepoluan
  • 6,132
  • 4
  • 46
  • 76