Why do openssl and ssh of Git for Windows report different versions of OpenSSL

gitopenssl

On Windows Server 2008, I have an installation of Git for Windows (Git-1.9.4-preview20140929).

Within a bash shell, openssl version reports version 0.9.8zb, but ssh -V reports Open SSL 1.0.1i.

So, which version accurately reflects the version of OpenSSL that would be used by an SSL connector within JBoss (via torquebox) running on this server?

Why would these two tools, supplied within the same version of Git for Windows not have matching OpenSSL versions?

Best Answer

I have an outdated (1.8.X) installation of Git for Windows1 so this might be not up to date, but from what I see in my installation, ssh.exe (which is a build of OpenSSH) depends on msys-crypto-X.Y.Z.dll while openssl.exe depends on that library and msys-ssl-X.Y.Z.dll with these X.Y.Z parts matching ("0.9.8" in my case). These libraries are located in the same directory as the executable files in question: {gitInstallDir}/bin.

AFAIK, when building GfW, the build suite pulls and builds exactly one copy of OpenSSL so both the reslting openssl.exe and ssh.exe are expected to use the same set of libraries provided by OpenSSL. Hence I sense some sort of %PATH% precedence problem.

What I would check:

  1. Run

    type -a openssl
    

    and

    type -a ssh
    

    in your Git Bash prompt, and see if they both return something starting with the "/bin/" prefix as the first (or sole) entry of their respective outputs. If you see something other, like "/c/whatever/other/path/openssl", you have another instance of the openssl.exe program available earlier than the Git for Windows' copy thanks to your %PATH%; the same applies to ssh.exe.

    If yes, fix the contents of %PATH%.

  2. Get a copy of depends.exe and run it against ssh.exe and openssl.exe from your GfW install to see which libraries they link to, and where those are located. This might give you the clue as to where to look if something appears to be wrong.


1 It's not "msysGit" but "Git for Windows": "msysGit" is a very old name of the project which is used for quite some time to refer to the development environment for Git for Windows while the latter term is used to refer to the end product: the Windows port of Git and a binary installer you've used to install GfW. Please stick to this terminology to not increase the confusion.