Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions src/native/libs/System.Security.Cryptography.Native/opensslshim.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,20 @@ static void OpenLibraryOnce(void)
// Android OpenSSL has no soname
DlOpen(LIBNAME);
}
#endif

#elif defined(__FreeBSD__)
// The ports version of OpenSSL is used over base where possible
if (libssl == NULL)
{
// Prefer OpenSSL 3.x
DlOpen(MAKELIB("3"));
// OpenSSL 3.5 from ports
DlOpen(MAKELIB("17"));
}

if (libssl == NULL)
{
DlOpen(MAKELIB("1.1"));
// OpenSSL 3.5 from base as found in FreeBSD 15.0
DlOpen(MAKELIB("35"));
}

#ifdef __FreeBSD__
// The ports version of OpenSSL is used over base where possible
if (libssl == NULL)
{
// OpenSSL 3.0 from ports
Expand All @@ -114,6 +113,16 @@ static void OpenLibraryOnce(void)
}
#endif

if (libssl == NULL)
{
// Prefer OpenSSL 3.x
DlOpen(MAKELIB("3"));
}

if (libssl == NULL)
{
DlOpen(MAKELIB("1.1"));
}
}

static pthread_once_t g_openLibrary = PTHREAD_ONCE_INIT;
Expand Down
Loading