Openssl not working in windows (SSLEAY32.dll error)

Recently I had to setup a self signed certificate for a Windows Apache setup. This of course requires the usage of openssl. However openssl returned the following error code when trying to use it:

The ordinal 296 could not be located in the dynamic link library SSLEAY32.dll

It turns out that the problem is related to the built in distribution of OpenSSL that ships with some WAMP versions. In order to correct it you would need to download and install the Windows version of OpenSSL from here:

http://slproweb.com/products/Win32OpenSSL.html

Choose the latest 64 or 32 bit version according to your setup, the light versions should be fine for our purposes. The one I used when writing this article was

Win64 OpenSSL v0.9.8y Light

After OpenSSL is installed, go to the install location and copy the following three files (they might be spread across folders depending on the version and architecture):
ssleay32.dll
libeay32.dll
openssl.exe

and paste them to your apache/bin folder, overwriting any existing ones. That fixed it for me.

  • Kamaro Lambert

    VERY NICE!

  • J

    Seems XAMPP shipped with a broken OpenSSL. This fixed my problem.

  • Lorenzo Amos

    Thanks for sharing. You can solve this problem easialy using http://fix4dll.com/xlive_dll just find the file you need and I’m sure you’ll solve it. Good luck.

  • 3lbisivni

    These files no longer appear to be included in the more recent versions of OpenSSL.

    • Chris Treber

      Same here. How does one get this thing (from a reputable source) without compiling oneself?