diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2021-02-11 08:06:32 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2021-02-11 10:37:17 +0000 |
commit | fb9f1c0356d4907a045391840d57bbe21cbf83a8 (patch) | |
tree | 51861e80ce9ec43cb6e0810c88574069b69eaaf4 /url.c | |
parent | Merge pull request #164 from bptato/brotli (diff) | |
download | w3m-fb9f1c0356d4907a045391840d57bbe21cbf83a8.tar.gz w3m-fb9f1c0356d4907a045391840d57bbe21cbf83a8.zip |
Update ssl_min_version to accept "all" and reject "SSLv2"
Diffstat (limited to '')
-rw-r--r-- | url.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -297,6 +297,10 @@ init_PRNG() static int str_to_ssl_version(const char *name) { + if(!strcasecmp(name, "all")) + return 0; + if(!strcasecmp(name, "none")) + return 0; #ifdef TLS1_3_VERSION if (!strcasecmp(name, "TLSv1.3")) return TLS1_3_VERSION; @@ -317,11 +321,7 @@ str_to_ssl_version(const char *name) return SSL3_VERSION; if (!strcasecmp(name, "SSLv3")) return SSL3_VERSION; - if (!strcasecmp(name, "SSLv2.0")) - return SSL2_VERSION; - if (!strcasecmp(name, "SSLv2")) - return SSL2_VERSION; - return 0; + return -1; } #endif /* SSL_CTX_set_min_proto_version */ @@ -372,7 +372,7 @@ openSSLHandle(int sock, char *hostname, char **p_cert) if (ssl_min_version && *ssl_min_version != '\0') { int sslver; sslver = str_to_ssl_version(ssl_min_version); - if (sslver <= 0 + if (sslver < 0 || !SSL_CTX_set_min_proto_version(ssl_ctx, sslver)) { free_ssl_ctx(); goto eend; |