Knowledgebase: Common issues with TWebUpdate and TWebCopy SFTP connection

If you are trying to connect to your SFTP server with TWebUpdate or TWebCopy then first read requirements. Further below you can also find some steps that can get you moving forward if you experience exceptions when you start your application or try to connect.

DLL requirements

This is always the first step, make sure you have all the necessary DLLs for your application to load. The following DLLs are required:

  • libssh2.dll
  • libssl-1_1.dll
  • libcrypto-1_1.dll

For 64-bit applications use libssh2_x64.dll, libssl-1_1_x64.dll and libcrypto-1_1_x64.dll but don't forget to remove the _x64 suffix. You can find all these DLLs in your installation folder.

Old DLL versions
Previously older version of DLLs were distributed, namely:

  • libeay32.dll
  • ssleay32.dll

If you are suddenly having issues connecting to your server, please try with the newer DLLs:

  1. Remove libeay32.dll and ssleay32.dll.
  2. Add libssl-1_1.dll and libcrypto-1_1.dll from the installation folder.
  3. Replace libssh2.dll with a newer one from the installation folder.

I get the following message: "Update failed with external exception C06D007E"

If your application can load the required DLLs listed but you see the message above, it's possible you are missing one more DLL that should be available on your system by default: MSVCR110.dll.
You can obtain this by installing the 32-bit version of Visual C++ Redistributable for Visual Studio 2012 Update 4: https://www.microsoft.com/en-us/download/details.aspx?id=30679

I still get exceptions when I try to connect with SFTP

The exception will most likely be realted to DLLs. Try the following to understand why libssh2.dll cannot be loaded:

  • In the libssh2_sftp unit search for the line you see below and temporarily comment out the delayed keyword to disable the delayed loading of the libssh2.dll:
    function libssh2_sftp_init; external libssh2_name{$ifdef allow_delayed} delayed{$endif};
    
  • Start your application. Without the delayed keyword the application will try to load the DLL on startup. In most cases this will give you another exception that points in the right direction. Try to look up what the code you get means.

For example:
When trying to load a 32-bit libssh2.dll for a 64-bit application, you get the following exception on connection:


And after removing the delayed keyword:
image
Looking up the code 0xc000007b you'll find answers mentioning a mix between 32-bit and 64-bit applications which immediately hints to incorrect DLL version usage.

Hi,

I followed all those steps. I do not get exception, but recently I get
"Cannot connect to SFTP server ssh.strato.com"
The support at Strato says "nothing has changed".
I know I did not change anything.
Do you have any idea what can cause this? Windows update? Security?
This happens on a variety of machines.

Any hint is welcome,

kind regards,

Dirk Janssens.

Most likely you'll need to use an updated openssl library

Thank you Bruno.
I used the dlls that ship with TMS: libeay32.dll and ssleay32.dll
WebCopy version 2.5.1.0
These are no longer usefull ?

Now, I downloaded the latest version openssl 3.3.
I see it consists of the files libssl.dll and libcrypto.dll.

My WebCopy application however still expects files libeay32.dll and ssleay32.dll

Renaming them gives errors...

How can I use the new openssl library with the webcopy?
Or do I have to use another version of the openssl ?

kind regards,

Dirk Janssens.

I also searched specificly for the latest ssleay.dll and libeay32.dll,
(versions 1.1.0.4 and 1.0.2.15 resp).
without any succes....

I hope you can help me, this is a big problem for me.

kind regards,

Dirk Janssens.

Hi,

Normally the libeay32.dll and ssleay32.dll that come with the installation should be OK. Can you try the libssh DLLs below?
https://download.tmssoftware.com/download/libssh2.zip

You should then have:

  • libeay32 (installation, remove)
  • ssleay (installation, remove)
  • libssh2 (replace)
  • libcrypto-1_1 (add)
  • libssl-1_1 (add)
1 Like

thank you very much!
It works now!!

Just to be sure: form now on, I need 5 files to make it work?
It still depends also on ssleay and libeay?

kind regards,

Dirk Janssens

Hi,

Actually, you can remove the libeay and ssleay DLLs. Just checked and these are the old versions OpenSSL used, they changed the naming to libcrypto and libssl, and the new libssh.dll is linking to those.

1 Like

Ah OK, I understand.
Thank you!