Skip to content

System.Security.Cryptography.Native.Openssl should not load OpenSSL eagerly on macOS #46771

@VSadov

Description

@VSadov

OpenSSL is optional on macOS - it's needed only for AES-GCM/CCM encryption.

However we have __attribute__((constructor)) static void InitializeOpenSSLShim() which aborts if OpenSSL is not found.
As a result, when System.Security.Cryptography.Native.Openssl is statically linked in a single-file scenario, every app will probe for OpenSSL and fail if not found.

We need to either delay-load on first use or invoke initialization explicitly from managed code.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions