Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I would like to set the TLS 1.2 configuration as below in my linux application.

ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
ECDHE_ECDSA_WITH_AES_128_GCM_SHA256

I know of the API SSL_CTX_set_cipher_list(SSL *ssl, const char *str); My question is how do I set more than one cipher using this API. Should I call this API twice or how else?

Currently I am setting only one configuration like this:

SSL_CTX_set_cipher_list(ctx, ECDHE-RSA-AES256-GCM-SHA384)

How do I set both the configurations as listed above?

Based on https://www.openssl.org/docs/man1.0.2/man1/ciphers.html "The cipher list consists of one or more cipher strings separated by colons. Commas or spaces are also acceptable separators but colons are normally used."

I would say 'ECDHE_ECDSA_WITH_AES_256_GCM_SHA384:ECDHE_ECDSA_WITH_AES_128_GCM_SHA256'

Thanks. I have a follow up question. I have been advised to use the method TLS_server_method( ) instead of fixing the method to TLS v1.2 considering the various clients that can connect. How do I then set the cipher suite in case the client connects in TLSv1.2 mode to ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 ECDHE_ECDSA_WITH_AES_128_GCM_SHA256. – Embedded Enthusiast Oct 2, 2021 at 15:26

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.