Properly handle libcrypto library search on macOS.
Properly handle libcrypto library search on macOS.

macOS has been steadily moving towards requiring programmers to directly
link against the library version they prefer and forbidding linking against
unversioned libraries. With Catalina this has moved from simply logging a
warning when a programmer links against an unversioned library (typically a
stub) to outright crashing with a pretty clear error.

In an effort to honor Apple's intentions but not completely reimplement
their dlopen methods, this change takes advantage of Apple's library
naming scheme to load the most recent versioned dylib while ignoring the
unversioned stub.

Fixes: #55084

Signed-off-by: Thomas J. Gallen <64d306d647c91b902e85cbeb88a90017eaa4ab1e@gmail.com>

saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt