PowerShell / Win32-OpenSSH

Win32 port of OpenSSH
7.36k stars 757 forks source link

Error "BN_is_negative not found in DLL" when calling ssh after moving exe #2228

Closed trallnag closed 5 months ago

trallnag commented 5 months ago

Prerequisites

Steps to reproduce

Install OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2.

I have installed it using WinGet from the package Microsoft.OpenSSH.Beta.

Copy C:\Program Files\OpenSSH\ssh.exe to $HOME.

Run $HOME\ssh.exe -V in PowerShell. Observe error.

Expected behavior

> C:\Users\tim\ssh.exe -V
OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

Actual behavior

> C:\Users\tim\ssh.exe -V
Window pop ups with error message

> echo $LASTEXITCODE
-1073741511

Error details

No response

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Version

OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

Visuals

Screenshot 2024-04-28 191308
tgauth commented 5 months ago

Try moving libcrypto.dll to the same folder as ssh.exe. It seems like it's picking up an older version of libcrypto.dll in the $env:PATH. See https://github.com/PowerShell/Win32-OpenSSH/issues/2052 for a similar issue.

trallnag commented 5 months ago

This indeed resolves the issue. Thanks for the hint.