ucspi-ssl  0.12.7
ucspi-ssl
ssl_ciphers.c
Go to the documentation of this file.
1 #include "ucspissl.h"
2 
3 int ssl_ciphers(SSL_CTX *ctx,const char *ciphers) {
4  int r = 0; // no cipher selected
5 
6  if (!ciphers) return -1;
7 
8 /* TLS <= 1.2 SSL_CTX_set_cipher_list()
9  TLS = 1.3 SSL_CTX_set_ciphersuites() [only OpenSSL here]
10 
11  see: https://community.openvpn.net/openvpn/ticket/1159
12 */
13 
14 #if (OPENSSL_VERSION_NUMBER > 0x10101000L && !LIBRESSL_VERSION_NUMBER) // 0xmnnffppsL
15  if ((r = SSL_CTX_set_ciphersuites(ctx,ciphers)) == 0)
16 #endif
17  r = SSL_CTX_set_cipher_list(ctx,ciphers); // TLS < 1.3 and fallback
18 
19  return r;
20 }
21 
int ssl_ciphers(SSL_CTX *ctx, const char *ciphers)
Definition: ssl_ciphers.c:3
const char * ciphers
Definition: sslclient.c:108
SSL_CTX * ctx
Definition: sslclient.c:103
Header file to be used with sqmail; previously called ssl.h. (name clash)