packages/mail/nail/patches/100-handle-openssl-without-sslv2-sslv3.patch
Eneas U de Queiroz 624d4c5efd nail: add compatibility with openssl 1.1
Openssl 1.1 doesn't support SSL2 and does not define the OPENSSL_NO_SSL2
flag either.  Also, it defaults to NO_EGD, so do not use EGD if it's not
enabled in openssl.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
2018-05-24 11:41:02 -03:00

22 lines
577 B
Diff

--- a/openssl.c
+++ b/openssl.c
@@ -216,11 +216,17 @@ ssl_select_method(const char *uhp)
cp = ssl_method_string(uhp);
if (cp != NULL) {
+#if !defined(OPENSSL_NO_SSL2) && !OPENSSL_VERSION_NUMBER >= 0x10100000L
if (equal(cp, "ssl2"))
method = SSLv2_client_method();
- else if (equal(cp, "ssl3"))
+ else
+#endif
+#ifndef OPENSSL_NO_SSL3
+ if (equal(cp, "ssl3"))
method = SSLv3_client_method();
- else if (equal(cp, "tls1"))
+ else
+#endif
+ if (equal(cp, "tls1"))
method = TLSv1_client_method();
else {
fprintf(stderr, catgets(catd, CATSET, 244,