Python Forum

Full Version: Unable to Use TLS 1.3 CCM Ciphers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, I'm trying to make a TLS 1.3 connection using the following ciphers:
  • TLS_AES_128_CCM_SHA256
  • TLS_AES_128_CCM_8_SHA256
These ciphers are not in the default cipher suite.
When trying to set any of them (or any TLS 1.3 cipher, for that matter), I receive 'No cipher can be selected' error.

My code, in its simplest form:
import ssl

if __name__ == '__main__':
    ctx = ssl.SSLContext(ssl.PROTOCOL_TLS)
    ctx.set_ciphers('TLS_AES_128_CCM_8_SHA256') # This is where the error is given
    print(ctx.get_ciphers()) 
The error:
Error:
ssl.SSLError: ('No cipher can be selected.',)
When Using the 'DEFAULT' cipher suite instead, I can see that three TLS 1.3 ciphers are included, as described in https://wiki.openssl.org/index.php/TLS1.3
However according to: https://docs.python.org/3/library/ssl.html
I cannot set TLS 1.3 ciphers. How can I use these two CCM ciphers? Thanks.