升级到 macOS Monterey 后,您可能会在尝试加载 OpenSSL 库时遇到错误。
Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI.
当尝试加载无版本号的 dylib 而非带版本号的库时,会出现此错误。
为避免此错误,OpenSSL_Options.UnixSymLinks 中新增了一个属性,可对此进行配置。
配置
使用属性 OpenSSL_Options.UnixSymLinks 启用或禁用在 Unix 系统下加载符号链接(默认启用,但在 OSX64 下除外):
- oslsSymLinksDefault:默认启用,但在 OSX64 下除外(macOS Monterey 之后,尝试加载无版本号库会失败)。
- oslsSymLinksLoadFirst:先加载符号链接,再尝试加载带版本号的库。
- oslsSymLinksLoad:先尝试加载带版本号的库,再加载符号链接。
- oslsSymLinksDontLoad:不加载符号链接。
procedure ConnectToServer; var oClient: TsgcWebSocketClient; begin oClient := TsgcWebSocketClient.Create(nil); oClient.Host := 'wss://www.esegece.com'; oClient.TLSOptions.OpenSSL_Options.UnixSymLinks := oslsSymLinksDontLoad; oClient.Active := True; end;
