[SOVLED] Indy does not work on macOS lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- teriyaki · 2022-02-03 11:56 my project uses Indy LCL. It works well on Windows 10 but it reports error on macOS I search on web and found that https://delphiworlds.com/2019/10/using-openssl-with-indy-in-notarized- apps-on-macos/ https://github.com/DelphiWorlds/KastriFree/tree/master/Lib/OpenSSL/1.0 .2s/macOS It is for Delphi Indy, but I guess it has similar mechanism with Lazarus so I download and copy libcrypto.1.0.0.dylib libssl.1.0.0.dylib to lib folder but nothing changes your comment welcome ---------------------------------------------------------------------- Remy Lebeau · 2022-02-03 18:08 Quote from: teriyaki on February 03, 2022, 12:56:38 pmbut it reports error on macOS Your code is crashing somewhere, but we can't see where exactly.  You will have to debug your project to find the actual cause and location of the crash.  What code is actually running at address 7FF811774112? One thing I will note - not related to the crash - you are leaking the TIdSSLIOHandlerSocketOpenSSL object.  At the very least, you should assign the TIdHTTP object as its Owner, so the SSLIOHandler object is freed when the TIdHTTP object is freed.  Why are you not creating the SSLIOHandler object at the same time as the TIdHTTP object? ---------------------------------------------------------------------- teriyaki · 2022-02-04 01:11 1.my code crashes at Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i s := idHTTP1.Get('https://hoppscotch.io') ; it works well on Windows10 2.the leaking the TIdSSLIOHandlerSocketOpenSSL object is avoidable, I free the object using code in the real project. the sample project is only for locating the bug where is, so I have minimized the codes. there is a syscall before the crash, so I guess the error relates to macOS limitation or something ---------------------------------------------------------------------- trev · 2022-02-04 01:39 See https://forum.lazarus.freepascal.org/index.php/topic,48423.msg3487 38.html#msg348738 for code which  works on macOS, FreeBSD, Ubuntu Linux and Windows. I was using FPC 3.3.1 at the time, but I believe it should now work with FPC 3.2.2. ---------------------------------------------------------------------- Remy Lebeau · 2022-02-04 17:37 Quote from: teriyaki on February 04, 2022, 02:11:43 ammy code crashes at Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i s := idHTTP1.Get('https://hoppscotch.io') ; That doesn't help narrow down the cause of the problem.  That is a very high-level method call.  There is a LOT of work going on inside of it.  So, you are going to have to narrow down the actual location of the crash inside of that call.  As Indy is open-source, feel free to trace into its source code with the debugger all you want. Quote from: teriyaki on February 04, 2022, 02:11:43 amit works well on Windows10 That doesn't help narrow down the cause of the problem.  99-odd% of Indy's code is the same across all platforms, but things like DLL access, socket API calls, etc are platform-specific.  Any one of them could be failing. ---------------------------------------------------------------------- teriyaki · 2022-02-08 00:37 I can not find libssl.1.0.0.dylib libcrypto.1.0.0.dylib in macOS /usr/lib when I try to copy the dylib to the folder, it reports error. Finally I found the possible way to forbid rootless, but that does not work for end users. https://apple.stackexchange.com/questions/208478/how-do-i-disable- system-integrity-protection-sip-aka-rootless-on-macos so I guess maybe I have to give up Indy on macOS ---------------------------------------------------------------------- trev · 2022-02-08 02:56 Quote from: teriyaki on February 08, 2022, 01:37:40 amI can not find libssl.1.0.0.dylib libcrypto.1.0.0.dylib in macOS /usr/lib See my Wiki article: Built-in dynamic linker cache. Quoteso I guess maybe I have to give up Indy on macOS No - You just have to do it the "right" way. Start with the Wiki article macOS application bundle to understand the bundle layout, macOS Libraries for an overview of libraries and then read macOS Dynamic Libraries for actual examples. ---------------------------------------------------------------------- teriyaki · 2022-02-10 04:17 when I track the code in IdTcpClient.pas of Indy Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TIdTCPClientCustom.Connect;begin  if Connected then begin    raise EIdAlreadyConnected.Create(RSAlreadyConnected);  end;   if Host = '' then begin    raise EIdHostRequired.Create('A Host is required'); {do not localize}  end;  if Port = 0 then begin    raise EIdPortRequired.Create('A Port is required'); {do not localize}  end;   if IOHandler = nil then begin    IOHandler := MakeImplicitClientHandler;    ManagedIOHandler := True;     // TODO: always assign the OnStatus event even if the IOHandler is not implicit?    IOHandler.OnStatus := OnStatus; // TODO: assign DoStatus() instead of the handler directly...  end;   try    // Bypass GetDestination    if FDestination <> '' then begin      IOHandler.Destination := FDestination;    end; {BGO: not any more, TIdTCPClientCustom has precedence now (for port protocols, and things like that)    // We retain the settings that are in here (filled in by the user)    // we only do this when the iohandler has no settings,  // because the iohandler has precedence    if (IOHandler.Port = 0) and (IOHandler.Host = '') then begin      IOHandler.Port := FPort;      IOHandler.Host := FHost;    end;}     IOHandler.Port := FPort; //BGO: just to make sure    IOHandler.Host := FHost;    IOHandler.ConnectTimeout := FConnectTimeout;    IOHandler.ReadTimeout := FReadTimeout;     if Socket <> nil then begin      Socket.BoundIP := FBoundIP;      Socket.BoundPort := FBoundPort;      Socket.BoundPortMin := FBoundPortMin;      Socket.BoundPortMax := FBoundPortMax;      Socket.IPVersion := FIPVersion;      Socket.ReuseSocket := FReuseSocket;      Socket.UseNagle := FUseNagle;      Socket.OnBeforeBind := FOnBeforeBind;      Socket.OnAfterBind := FOnAfterBind;      Socket.OnSocketAllocated := FOnSocketAllocated;    end;     IOHandler.Open;  //[b]error happens here[/b]    if IOHandler.Intercept <> nil then begin      IOHandler.Intercept.Connect(Self);    end;     DoStatus(hsConnected, [Host]);    DoOnConnected;  except    if IOHandler <> nil then begin    IOHandler.Close;      if ManagedIOHandler then begin        IOHandler := nil; // RLebeau - SetIOHandler() will free the IOHandler      end;    end;    raise;  end;end; error happens at the line with the same message as before Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i IOHandler.Open; but I set the breakpoint in IdIoHandler.pas Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TIdIOHandler.Open;begin  FOpened := False;  FClosedGracefully := False;  WriteBufferClear;  FInputBuffer.Clear;  FOpened := True;end; //break point is here has no any problem then on macOS, it reports error Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI. detail: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i -------------------------------------Translated Report (Full Report Below)------------------------------------- Process:               project1 [10003]Path:                  /Users/USER/*/project1.app/Contents/MacOS/project1Identifier:          project1Version:               ???Code Type:             X86-64 (Native)Parent Process:        Exited process [10004]User ID:             501 Date/Time:             2022-02-10 21:59:02.1084 +0800OS Version:            macOS 12.1 (21C52)Report Version:        12Anonymous UUID:        9B1FF271-B044-78C8-F1D7-3FEAC1F77C92 Sleep/Wake UUID:       60C34E95-79CB-4A28-B8A5-31E229056DB1 Time Awake Since Boot: 41000 secondsTime Since Wake:       16773 seconds System Integrity Protection: enabled Crashed Thread:        0  Dispatch queue: com.apple.main-thread Exception Type:        EXC_CRASH (SIGABRT)Exception Codes:       0x0000000000000000, 0x0000000000000000Exception Note:        EXC_CORPSE_NOTIFY External Modification Warnings:Debugger attached to process. Application Specific Information:Performing @selector(actionButtonClick:) from sender TCocoaButton 0x103828940abort() calledInvalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI.  Thread 0 Crashed::  Dispatch queue: com.apple.main-thread0   libsystem_kernel.dylib                  0x7ff807ad1112 __pthread_kill + 101   libsystem_pthread.dylib               0x7ff807b07214 pthread_kill + 2632   libsystem_c.dylib                     0x7ff807a53d10 abort + 1233   libcrypto.dylib                       0x7ffb1dbfcaee __report_load.cold.1 + 364   libcrypto.dylib                         0x7ffb1dbfc807 __report_load + 4275   dyld                                       0x102340b49 invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 1826   dyld                                       0x10236729b invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 2427   dyld                                     0x10235e893 invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 5668   dyld                                     0x10232dd91 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 1299   dyld                                     0x10235e61b dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 17910  dyld                                       0x102366df2 dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 46611  dyld                                     0x102340a7c dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 14412  dyld                                       0x1023471ee dyld4::PrebuiltLoader::runInitializers(dyld4::RuntimeState&) const + 3013  dyld                                       0x102340c08 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array&) const + 17814  dyld                                     0x102340cac dyld4::Loader::runInitializersBott omUpPlusUpwardLinks(dyld4::RuntimeState&) const + 10815  dyld                                     0x10234f9b5 dyld4::APIs::dlopen_from(char const*, int, void*) + 56316  project1                                 0x1000595db DYNLIBS_$$_SYSLOADLIBRARYA$RAWBYTESTRING$$INT64 + 2717  project1                                   0x10060d9fc IDGLOBAL_$$_HACKLOAD$ANSISTRING$array_of_ANSISTRING$$INT64 + 204 (IdGlobal.pas:4724)18  project1                                   0x1007d9824 IDSSLOPENSSLHEADERS_$$_LOADSSLCRYPTOLIBRARY$$INT64 + 260 (IdSSLOpenSSLHeaders.pas:22747)19  project1                                 0x1007d9f64 IDSSLOPENSSLHEADERS_$$_LOAD$$BOOLEAN + 292 (IdSSLOpenSSLHeaders.pas:22919)20  project1                                 0x10075c5d5 IDSSLOPENSSL_$$_LOADOPENSSLLIBRARY$$BOOLEAN + 117 (IdSSLOpenSSL.pas:2355)21  project1                                   0x10075f6c1 IDSSLOPENSSL$_$TIDSSLCONTEXT_$__$$_CREATE$$TIDSSLCONTEXT + 209 (IdSSLOpenSSL.pas:3186)22  project1                                 0x10075e74a IDSSLOPENSSL$_$TIDSSLIOHANDLERSOCKETOPENSSL_$__$$_INIT + 58 (IdSSLOpenSSL.pas:2915)23  project1                                   0x10075df94 IDSSLOPENSSL$_$TIDSSLIOHANDLERSOCKETOPENSSL_$__$$_CONNECTCLIENT + 100 (IdSSLOpenSSL.pas:2783)24  project1                                   0x1006516a5 IDIOHANDLERSOCKET$_$TIDIOHANDLERSOCKET_$__$$_OPEN + 293 (IdIOHandlerSocket.pas:369)25  project1                                 0x10075e24b IDSSLOPENSSL$_$TIDSSLIOHANDLERSOCKETOPENSSL_$__$$_OPEN + 43 (IdSSLOpenSSL.pas:2829)26  project1                                 0x10065e035 IDTCPCLIENT$_$TIDTCPCLIENTCUSTOM_$__$$_CONNECT + 1365 (IdTCPClient.pas:328)27  project1                                   0x1006d1e85 IDHTTP$_$TIDCUSTOMHTTP_$__$$_CHECKANDCONNECT$TIDHTTPREQUE ST$TIDHTTPRESPONSE + 1285 (IdHTTP.pas:1932)28  project1                                 0x1006d29ab IDHTTP$_$TIDCUSTOMHTTP_$__$$_CONNECTTOH OST$TIDHTTPREQUEST$TIDHTTPRESPONSE + 2619 (IdHTTP.pas:2129)29  project1                                   0x1006d7154 IDHTTP$_$TIDCU STOMHTTP_$__$$_DOREQUEST$ANSISTRING$ANSISTRING$TSTREAM$TSTREAM$array_o f_SMALLINT + 628 (IdHTTP.pas:3170)30  project1                                 0x1006d6e81 IDHTTP$_$TIDCUSTOMHTTP_$__$$_GET$ANSISTRING$TSTREAM$array_of_SMALLINT + 305 (IdHTTP.pas:3139)31  project1                                   0x1006d6c87 IDHTTP$_$TIDCUSTOMHTTP_$__$$_GET$ANSISTRING$array_of_SMAL LINT$IIDTEXTENCODING$$ANSISTRING + 279 (IdHTTP.pas:3127)32  project1                                 0x1006ce7f0 IDHTTP$_$TIDCUSTOMHTTP_$__ $$_GET$ANSISTRING$IIDTEXTENCODING$$ANSISTRING + 128 (IdHTTP.pas:1136)33  project1                                   0x10004a728 MAINFORMUNIT$_$TFORM1_$__$$_BUTTON3CLICK$TOBJECT + 248 (mainformunit.pas:134)34  project1                                   0x100231c27 CONTROLS$_$TCONTROL_$__$$_CLICK + 103 (control.inc:2957)35  project1                                   0x1002da729 STDCTRLS$_$TBUTTONCONTROL_$__$$_CLICK + 41 (buttoncontrol.inc:55)36  project1                                   0x1002daf99 STDCTRLS$_$TCUSTOMBUTTON_$__$$_CLICK + 89 (buttons.inc:169)37  project1                                   0x1002da602 STDCTRLS$_$TBUTTONCONTROL_$__$$_WMDEFAULTCLICKED$TLMESSAGE + 66 (buttoncontrol.inc:21)38  project1                                   0x10001743a SYSTEM$_$TOBJECT_$__$$_DISPATCH$formal + 17039  project1                                 0x100222b6d CONTROLS$_$TWINCONTROL_$__$$_WNDPROC$TLMESSAGE + 941 (wincontrol.inc:5429)40  project1                                   0x10020d7dd LCLMESSAGEGLUE_$$_DELIVERMESSAGE$TOBJECT$formal$$INT64 + 237 (lclmessageglue.pas:112)41  project1                                 0x10020d8f6 LCLMESSAGEGLUE_$$_SENDSIMPLEMESSAGE$TCONTROL$LONGWORD$$INT64 + 54 (lclmessageglue.pas:143)42  project1                                   0x1002f5102 COCOAWSSTDCTRLS$_$TLCLBUTTONCALLBACK_$__$$_BUTTONCLICK + 66 (cocoawsstdctrls.pas:555)43  project1                                 0x1002fbb77 -[TCocoaButton actionButtonClick:] + 87 (cocoabuttons.pas:301)44  AppKit                                  0x7ff80a80072d -[NSApplication(NSResponder) sendAction:to:from:] + 28845  AppKit                                  0x7ff80a8005d4 -[NSControl sendAction:to:] + 8646  AppKit                                0x7ff80a800506 __26-[NSCell _sendActionFrom:]_block_invoke + 13147  AppKit                                  0x7ff80a80040f -[NSCell _sendActionFrom:] + 17148  AppKit                                  0x7ff80a800356 -[NSButtonCell _sendActionFrom:] + 9649  AppKit                                0x7ff80a7fd1c4 NSControlTrackMouse + 181750  AppKit                                  0x7ff80a7fca87 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 12151  AppKit                                0x7ff80a7fc95a -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 67952  AppKit                                0x7ff80a7fbd28 -[NSControl mouseDown:] + 67853  project1                                   0x1002fc3fe -[TCocoaButton mouseDown:] + 158 (cocoabuttons.pas:423)54  AppKit                                0x7ff80a7fa207 -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 494955  AppKit                                0x7ff80a76e150 -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 258256  AppKit                                0x7ff80a76d51a -[NSWindow(NSEventRouting) sendEvent:] + 35257  project1                                   0x1001fb5ec -[TCocoaWindow sendEvent:] + 508 (cocoawindows.pas:992)58  AppKit                                0x7ff80a76b8e8 -[NSApplication(NSEvent) sendEvent:] + 35259  project1                                   0x1001d3184 -[TCocoaApplication sendEvent:] + 916 (cocoaint.pas:571)60  project1                                   0x1001d3949 COCOAINT$_$TCOCOAWIDGETSET_$__$$_APPRUNMESSAGES$BOOLEAN$NSDATE + 153 (cocoaobject.inc:96)61  project1                                   0x1001d39bd COCOAINT$_$TCOCOAWIDGETSET_$__$$_APPPROCESSMESSAGES + 29 (cocoaobject.inc:114)62  project1                                   0x10004335d FORMS$_$TAPPLICATION_$__$$_HANDLEMESSAGE + 45 (application.inc:1264)63  project1                                   0x1000438df FORMS$_$TAPPLICATION_$__$$_RUNLOOP + 79 (application.inc:1383)64  project1                                   0x1001d29e5 -[TCocoaApplication run] + 53 (cocoaint.pas:468)65  project1                                   0x1001d3893 COCOAINT$_$TCOCOAWIDGETSET_$__$$_APPRUN$TAPPLICATIONMAINLOOP + 83 (cocoaobject.inc:78)66  project1                                   0x100043888 FORMS$_$TAPPLICATION_$__$$_RUN + 104 (application.inc:1371)67  project1                                   0x10000488d PASCALMAIN + 109 (project1.lpr:21)68  project1                                 0x1000288ec FPC_SysEntry + 1269  dyld                                     0x1023314fe start + 462 Thread 1:0   libsystem_pthread.dylib                 0x7ff807b02fec start_wqthread + 0 ---------------------------------------------------------------------- Remy Lebeau · 2022-02-10 17:36 Quote from: teriyaki on February 10, 2022, 05:17:18 amwhen I track the code in IdTcpClient.pas of Indy ... error happens at the line with the same message as before Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i IOHandler.Open; but I set the breakpoint in IdIoHandler.pas ... has no any problem That is because you put your breakpoint in the wrong place. When using OpenSSL, the call to IOHandler.Open() will call TIdSSLIOHandlerSocketOpenSSL.Open(): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TIdSSLIOHandlerSocketOpenSSL.Open;begin  FOpened := False;  inherited Open;end; Where inherited will then call TIdIOHandlerSocket.Open(): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TIdIOHandlerSocket.Open;begin  inherited Open;   if not Assigned(FBinding) then begin    FBinding := TIdSocketHandle.Create(nil);  end else begin    FBinding.Reset(True);  end;  FBinding.ClientPortMin := BoundPortMin;  FBinding.ClientPortMax := BoundPortMax;   //if the IOHandler is used to accept connections then port+host will be empty  if (Host <> '') and (Port > 0) then begin    ConnectClient;  end;end; Where inherited will then call TIdIOHandler.Open() (where you put your breakpoint), and then ConnectClient() will call TIdSSLIOHandlerSocketOpenSSL.ConnectClient(): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TIdSSLIOHandlerSocketOpenSSL.ConnectClient;var  LPassThrough: Boolean;begin  // RLebeau: initialize OpenSSL before connecting the socket...  try    Init;  except    on EIdOSSLCouldNotLoadSSLLibrary do begin      if not PassThrough then raise;    end;  end;  // RLebeau 1/11/07: In case a proxy is being used, pass through  // any data from the base class unencrypted when setting up that  // connection.  We should do this anyway since SSL hasn't been  // negotiated yet!  LPassThrough := fPassThrough;  fPassThrough := True;  try    inherited ConnectClient;  finally    fPassThrough := LPassThrough;  end;  DoBeforeConnect(Self);  // CreateSSLContext(sslmClient);  // CreateSSLContext(SSLOptions.fMode);  StartSSL;end; Where Init() loads the OpenSSL libs, inherited calls TIdIOHandlerStack.ConnectClient() to establish the TCP connection, and StartTLS() establishes a TLS session if fPassThrough is False. So, your error is coming from TIdSSLIOHandlerSocketOpenSSL.Init(), which creates a TIdSSLContext object, which calls LoadOpenSSLLibrary(), which calls IdSSLOpenSSLHeaders.Load(), which loads the actual dylibs. Quote from: teriyaki on February 10, 2022, 05:17:18 amthen on macOS, it reports error Invalid dylib load. Clients should not load the unversioned libcrypto dylib as it does not have a stable ABI. By default, on 'Nix-based platforms (which includes Mac), IdSSLOpenSSLHeaders.Load() looks for unversioned dylibs first.  If they are not found, it then looks for dylibs of specific OpenSSL versions from 1.0.2 down to 0.9.6. Using the unversioned dylibs used to work fine in the past, as they were typically just symlinks to newer OpenSSL versions, and OpenSSL used to be largely backwards compatible, thus admins could freely upgrade OpenSSL without breaking Indy. But OpenSSL redesigned its API in 1.1.0, breaking lots of backwards compatibility, and now on modern systems those unversioned dylibs tend to be symlinks to OpenSSL versions that are no longer compatible with TIdSSLIOHandlerSocketOpenSSL.  So, to use OpenSSL 1.1.x+ with Indy, you need to use this SSLIOHandler instead (work in progress). Otherwise, if you want to continue using TIdSSLIOHandlerSocketOpenSSL, you can call IdOpenSSLSetCanLoadSymLinks(False) or IdOpenSSLSetLoadSymLinksFirst(False) beforehand to prevent Indy from looking for those unversioned dylibs.  You will just have to ship the desired version-specific dylibs with your app so Indy can find them (you might need to call IdOpenSSLSetLibPath() for that). ---------------------------------------------------------------------- teriyaki · 2022-02-14 02:25 Thanks for your patience and professional your solution 2 works for me QuoteOtherwise, if you want to continue using TIdSSLIOHandlerSocketOpenSSL, you can call IdOpenSSLSetCanLoadSymLinks(False) or IdOpenSSLSetLoadSymLinksFirst(False) beforehand to prevent Indy from looking for those unversioned dylibs.  You will just have to ship the desired version-specific dylibs with your app so Indy can find them (you might need to call IdOpenSSLSetLibPath() for that). but I still have question about solution 1 QuoteBut OpenSSL redesigned its API in 1.1.0, breaking lots of backwards compatibility, and now on modern systems those unversioned dylibs tend to be symlinks to OpenSSL versions that are no longer compatible with TIdSSLIOHandlerSocketOpenSSL.  So, to use OpenSSL 1.1.x+ with Indy, you need to use this SSLIOHandler instead (work in progress). I checked link at https://github.com/IndySockets/Indy/pull/299 but can not find the exact source code/way to make indy work with system new version openssl my macOS openssl is LibreSSL 2.8.3 there is someone's openssl.zip https://github.com/IndySockets/Indy/files/5029069/OpenSSL.zip but I search the files of the zip file , but no found any one in my Indy folder. I wonder if it is the official source codes for openssl? ---------------------------------------------------------------------- Thaddy · 2022-02-14 08:56 libressl<> openssl. The official is at openssl.org ---------------------------------------------------------------------- Remy Lebeau · 2022-02-15 03:38 Quote from: teriyaki on February 14, 2022, 03:25:08 amI checked link at https://github.com/IndySockets/Indy/pull/299 but can not find the exact source code/way to make indy work with system new version openssl The Pull Request links to https://github.com/mezen/Indy/tree/NewOpenSSL_PR for the actual code files.  There is a whole new set of SSLIOHandler classes for working with OpenSSL 1.1.x+, the old SSLIOHandler for OpenSSL is not updated.  You use the new classes similarly to how you use the old class (ie, create an instance of the appropriate class, configure it as needed, and assign it to a TCP component's IOHandler property). Quote from: teriyaki on February 14, 2022, 03:25:08 ammy macOS openssl is LibreSSL 2.8.3 LibreSSL is a fork of OpenSSL, originally from version 1.0.1. Indy does not officially support LibreSSL, however, there is SOME code in place that makes Indy more lenient to LibreSSL's filenames so those libs can be loaded as-if they were OpenSSL libs, but that is about the extent of LibreSSL support in Indy (see https://github.com/IndySockets/Indy/issues/231).  However, that only applies to the old OpenSSL SSLIOHandler, I have no clue whether the new OpenSSL SSLIOHandler classes even allow LibreSSL at all. Quote from: teriyaki on February 14, 2022, 03:25:08 amthere is someone's openssl.zip https://github.com/IndySockets/Indy/files/5029069/OpenSSL.zip Wherever did you find that?  I have no idea how or why that zip file is in Indy's repo.  It is not linked to by anything in the repo, and is not found when using the "Go to file" feature. Looking at the files inside of that zip, they appear to be related to the Pull Request to add OpenSSL 1.1.x to Indy. Quote from: teriyaki on February 14, 2022, 03:25:08 ambut I search the files of the zip file , but no found any one in my Indy folder. Of course not, because the Pull Request hasn't been merged into Indy's main code yet.  It is still a work in progress.  That is why if you want to use the new SSLIOHandler classes, you need to install those files on top of Indy.