From da6e4bb3899e9c00becf91facd3e5a25127b4049 Mon Sep 17 00:00:00 2001 From: Jason Pugsley Date: Thu, 16 Apr 2020 03:27:14 +1000 Subject: [PATCH] Add FreeBSD-specific SONAME versions to portable OpenSSL probing. The version of OpenSSL installed will depend on the version of FreeBSD and whether OpenSSL has been updated from the FreeBSD Ports collection. The order of attempted loading is: libssl.so.11 (ports) libssl.so.111 (base FreeBSD using OpenSSL 1.1.1) libssl.so.8 (base FreeBSD using OpenSSL 1.0.2) --- .../System.Security.Cryptography.Native/opensslshim.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/libraries/Native/Unix/System.Security.Cryptography.Native/opensslshim.c b/src/libraries/Native/Unix/System.Security.Cryptography.Native/opensslshim.c index b33aa12..47ae111 100644 --- a/src/libraries/Native/Unix/System.Security.Cryptography.Native/opensslshim.c +++ b/src/libraries/Native/Unix/System.Security.Cryptography.Native/opensslshim.c @@ -97,6 +97,23 @@ static bool OpenLibrary() DlOpen(MAKELIB("10")); } + // FreeBSD uses a different suffix numbering convention. + // Current supported FreeBSD releases should use the order .11 -> .111 -> .8 + if (libssl == NULL) + { + DlOpen(MAKELIB("11")); + } + + if (libssl == NULL) + { + DlOpen(MAKELIB("111")); + } + + if (libssl == NULL) + { + DlOpen(MAKELIB("8")); + } + return libssl != NULL; } -- 2.7.4