Blame SOURCES/0005-Prefer-OpenSSL-1.0.x-for-portable-builds.patch

105ad9
From 60e4274ff758af0d68ba585e7286a5cddb7c4778 Mon Sep 17 00:00:00 2001
105ad9
From: Omair Majid <omajid@redhat.com>
105ad9
Date: Thu, 10 Jan 2019 18:37:24 -0500
105ad9
Subject: [PATCH 5/7] Prefer OpenSSL 1.0.x for portable builds
105ad9
105ad9
Future releases of .NET Core prefer OpenSSL 1.1.x. For the sake of
105ad9
compatiblity, 2.x releases should prefer 1.0.x.
105ad9
---
105ad9
 .../opensslshim.cpp                                   | 11 +++++------
105ad9
 1 file changed, 5 insertions(+), 6 deletions(-)
105ad9
105ad9
diff --git a/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.cpp b/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.cpp
105ad9
index 585f7ac23f..c98869a94e 100644
105ad9
--- a/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.cpp
105ad9
+++ b/src/Native/Unix/System.Security.Cryptography.Native/opensslshim.cpp
105ad9
@@ -47,12 +47,6 @@ bool OpenLibrary()
105ad9
         libssl = dlopen(soName, RTLD_LAZY);
105ad9
     }
105ad9
 
105ad9
-    if (libssl == nullptr)
105ad9
-    {
105ad9
-        // Prefer OpenSSL 1.1.x
105ad9
-        libssl = dlopen("libssl.so.1.1", RTLD_LAZY);
105ad9
-    }
105ad9
-
105ad9
     if (libssl == nullptr)
105ad9
     {
105ad9
         // Debian 9 has dropped support for SSLv3 and so they have bumped their soname. Let's try it
105ad9
@@ -73,6 +67,11 @@ bool OpenLibrary()
105ad9
         libssl = dlopen("libssl.so.10", RTLD_LAZY);
105ad9
     }
105ad9
 
105ad9
+    if (libssl == nullptr)
105ad9
+    {
105ad9
+        libssl = dlopen("libssl.so.1.1", RTLD_LAZY);
105ad9
+    }
105ad9
+
105ad9
     return libssl != nullptr;
105ad9
 }
105ad9
 
105ad9
-- 
105ad9
2.20.1
105ad9