libssl.dll and libcrypto.dll should not be in system32

lars's Avatar


20 Oct, 2018 09:55 AM

RubyInstaller uses the MSYS2 environment for building on Appveyor. Ruby links to OpenSSL, which is provided by MSYS2-MINGW. The build runs fine until the compiled file is executed. It then fails to load the libcrypto-1_1-x64.dll. This is because there is an equally named file in c:/windows/system32 which Windows always prefers over any other DLLs in the PATH. The file in the windows system directory is based on OpenSSL-1.1.0, but I want to use OpenSSL-1.1.1, so that a generic DLL load error is raised.

Storing user files in system32 is a very bad practice, which leaded to the still known DLL hell. Although it is still allowed on a Windows system to store files there, it frequently results in dynamic loader issues like the above. And since the error message is often very generic, it requires a good understanding of Windows internals and long debugging sessions to figure this out. As a bonus the system32 directory is a per-platform directory, so that 32 bit DLLs only get visible only in a 32 application and 64 bit DLLs only in 64 bit applications. As a workaround I remove the files in question before starting the build. This looks like so: (see beginning of the log).

Please remove libssl*.dll, libcrypto*.dll from c:\windows\system32\! And even better also the old OpenSSL-0.x versions libeay32.dll and libssl32.dll. Please take special care due to the per-platform visibility of c:\windows\system32.

  1. Support Staff 1 Posted by Ilya Finkelshte... on 23 Oct, 2018 10:12 PM

    Ilya Finkelshteyn's Avatar

    Sorry for delay with reply. You are correct. Please watch

  2. Support Staff 2 Posted by Ilya Finkelshte... on 23 Oct, 2018 10:37 PM

    Ilya Finkelshteyn's Avatar
  3. Ilya Finkelshteyn closed this discussion on 23 Oct, 2018 10:37 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac