Skip to content

Commit 309009e

Browse files
authored
FreeBSD: Add suffix numbering for OpenSSL3
1 parent 8e23fec commit 309009e

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

src/native/libs/System.Security.Cryptography.Native/opensslshim.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,21 @@ static void OpenLibraryOnce(void)
116116
DlOpen(MAKELIB("10"));
117117
}
118118

119-
// FreeBSD uses a different suffix numbering convention.
120-
// Current supported FreeBSD releases should use the order .11 -> .111
119+
#ifdef __FreeBSD__
120+
// The ports version of OpenSSL is used over base where possible
121+
if (libssl == NULL)
122+
{
123+
// OpenSSL 3.0 from ports
124+
DlOpen(MAKELIB("12"));
125+
}
126+
127+
if (libssl == NULL)
128+
{
129+
// OpenSSL 3.0 from base as found in FreeBSD 14.0
130+
DlOpen(MAKELIB("30"));
131+
}
132+
133+
// Fallbacks for OpenSSL 1.1.x
121134
if (libssl == NULL)
122135
{
123136
DlOpen(MAKELIB("11"));
@@ -127,6 +140,8 @@ static void OpenLibraryOnce(void)
127140
{
128141
DlOpen(MAKELIB("111"));
129142
}
143+
#endif
144+
130145
}
131146

132147
static pthread_once_t g_openLibrary = PTHREAD_ONCE_INIT;

0 commit comments

Comments
 (0)