Recent

Author Topic: TFPHttpClient.Get throws Could not initialize OpenSSL library  (Read 311 times)

anse

  • Jr. Member
  • **
  • Posts: 52
  • Bugmonkey
    • HeidiSQL
TFPHttpClient.Get throws Could not initialize OpenSSL library
« on: December 17, 2025, 07:55:33 pm »
Lazarus 4.2 and FPC 3.2.2 on macOS Sequoia (M4 cpu).

When I use TFPHttpClient.Get with "https://test.de", it throws a EInOutError exception and says "Could not initialize OpenSSL library".

I am running the app in an app bundle with libssl + libcrypto 1.1 in the Frameworks directory:

Contents
  MacOS
    executable
  Frameworks
    libssl.1.1.dylib
    libcrypto.1.1.dylib
    ...


I tested and tried this in my own code, which succeeds! (<> NilHandle):

Code: Pascal  [Select][+][-]
  1. LoadLibrary(ExtractFilePath(Application.ExeName) + '../Frameworks/libssl.1.1.dylib')

On Windows, with the v1.1 dlls in the executable directory, I get no error.

I assume that openssl.LoadLibHack() on macOS does not load the libraries from the Framworks directory?
Do I need to give the openssl unit (or opensslsockets) a hint to the Frameworks directory somehow?
« Last Edit: December 18, 2025, 11:30:20 am by anse »

anse

  • Jr. Member
  • **
  • Posts: 52
  • Bugmonkey
    • HeidiSQL
Re: TFPHttpClient.Get throws Could not initialize OpenSSL library
« Reply #1 on: December 18, 2025, 02:01:45 pm »
Sorry, same question is answered in a different thread: https://forum.lazarus.freepascal.org/index.php/topic,72643.msg572546.html#msg572546

 

TinyPortal © 2005-2018