1

I have an install of OpenSSL 1.1.1f as per Ubuntu 20.04 and I specifically want the TLS v1.2 suite TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 (ECDHE-ECDSA-AES128-CCM8) enabled.

TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 is available

How do I configured OpenSSL to allow the use of that cipher suite for other apps that use the OpenSSL install for TLS?

Details about my use case: I have a .NET(6) app, and .NET uses the present OpenSSL 1.1.1 or greater install as the underlying TLS provider on Linux. So afaik when that app uses OpenSSL, OpenSSL needs to be configured to allow for the CCM cipher suites.(it will use the openssl.cnf as per openssl version -d)

I see in the config section of the OpenSSL manual that the module I am interested configuring is ssl_conf, and so I created the following cnf:

openssl_conf = default_conf

[default_conf]
ssl_conf = ssl_sect

[ssl_sect]
system_default = system_default_sect

[system_default_sect]
CipherString = ECDHE-ECDSA-AES128-CCM8                                                                                                                                                                                                                                                                                                                                              

but this doesn't allow the app to use TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8. When my TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 exclusive client tries to connect it gets a handshake 40 failure, as the app internally throws an 'Interop.OpenSsl.SslException' in System.Net.Security.dll

However, I confirmed this config file works because if I use the following cnf with instead TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 as the sole filter in the cipher string, then the app can exclusively use TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 and it works as expected (a ...GCM_SHA256 exclusive client can connect):

...
[system_default_sect]
CipherString = ECDHE-RSA-AES128-GCM-SHA256  

How do I enable TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8?

And I am not sure how to confirm the enabling of CCM... I am expecting that when I run openssl ciphers -v (with no cipher string filter) that I will see CCM8 listed, just as TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 is listed.

I read the Configuration section of this cook book: https://www.feistyduck.com/library/openssl-cookbook/online/openssl-command-line/configuration.html, but I think I need some experienced advice to explain why I cant just use CCM8.

3
  • 2
    What do you mean 'at the OS level'? The OS does not use OpenSSL; programs like apache(httpd) nginx php python curl wget and many more do. Some programs allow you to configure their cipherlist in a program-specific way; many (always or sometimes) use OpenSSL's default cipherlist for SSL/TLS, whose pre-compiled value excludes CCM, but (since 1.1.0) can be changed by an OpenSSL config file which defaults to /etc/ssl/openssl.cnf but can be overridden by env var OPENSSL_CONF; see man 5 config (openssl-config in some other systems). Jun 7, 2022 at 2:38
  • I will check out openssl-config and that is great if I don't have to recompile, and can just "activate" CCM via the configs. And yes I meant for other apps to use, such as those you listed. Updated question. Jun 7, 2022 at 3:07
  • I found the Micro Focus guide to OpenSsl very useful for getting a higher overview of OpenSSL configuration microfocus.com/documentation/visual-cobol/VC40/CSWin/… Jun 7, 2022 at 19:02

1 Answer 1

1

To "enable" a non default cipher suite for use with a .NET app one must configure OpenSSL. Many framework apps such as .NET apps use OpenSSL under the hood, one can create an OpenSSL config, and then set the environment variable OPENSSL_CONF to the full path to the config file. Most apps that use OpenSSL will use the OPENSSL_CONF environment variable to get the config file that should be used when using OpenSSL. OpenSSL will use a default openssl.cnf that doesn't enable all cipher suites to ensure apps don't use less secure cipher suites.

In the case of enabling an app to use TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 one could create the following config file:

# myCustomOpenSSL.cnf
openssl_conf = default_conf

[default_conf]
ssl_conf = ssl_sect

[ssl_sect]
system_default = system_default_sect

#CipherString is a colon separated list of terms that filter what TLS v1.2 suites OpenSSL will allow use of. 
[system_default_sect]
CipherString = ECDHE-ECDSA-AES128-CCM8   

and then set OPENSSL_CONF to /example/path/myCustomOpenSSL.cnf before starting the application from the same shell instance (so the OPENSSL_CONFis correct), or if you are developing the application you can set OPENSSL_CONF in your applications code.

...

My issue was that I had failed to provide the app with a ECDSA Cert. In order to use TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 the app must have an ECDSA certificate - that is it is signed with a ECDSA key. I was working in Visual Studio and running my app via WSL. Visual Studio installs default development certificates in /etc/ssl/certs. These default dev certs are RSA based, so while the app didn't complain about not having a certificate, it had an incompatible certificate hence the 'Interop.OpenSsl.SslException' in System.Net.Security.dll exception.

So I configured the app to use ECDSA based certificate over the default development RSA based certificate and voila!

So the cnf file I created was working to "enable" TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8.

Note: Using an OpenSSL cnf for cipher suite selection is not required with .NET as you can create a CipherSuitePolicy to define your apps cipher suites within the code.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .