New option ssl_cipher to specify ciphers for TLSv1.2 and below

This commit is contained in:
Tatsuya Kinoshita
2021-02-10 19:20:37 +09:00
parent 97c7d9b410
commit c01675d342
4 changed files with 16 additions and 3 deletions

8
url.c
View File

@@ -336,9 +336,11 @@ openSSLHandle(int sock, char *hostname, char **p_cert)
#endif
if (!(ssl_ctx = SSL_CTX_new(SSLv23_client_method())))
goto eend;
#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
SSL_CTX_set_cipher_list(ssl_ctx, "DEFAULT:!LOW:!RC4:!EXP");
#endif
if (ssl_cipher && *ssl_cipher != '\0')
if (!SSL_CTX_set_cipher_list(ssl_ctx, ssl_cipher)) {
free_ssl_ctx();
goto eend;
}
option = SSL_OP_ALL;
if (ssl_forbid_method) {
if (strchr(ssl_forbid_method, '2'))