Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(Windows) Missing (openssl) DLLs #107

Closed
DougAnderson444 opened this issue Mar 26, 2023 · 3 comments
Closed

bug(Windows) Missing (openssl) DLLs #107

DougAnderson444 opened this issue Mar 26, 2023 · 3 comments

Comments

@DougAnderson444
Copy link

I am trying to use str0m in VS Code on Windows 10, when I cargo run it appears some DLL files are not found:

exit code: 0xc0000135, STATUS_DLL_NOT_FOUND

full output:

Compiling str0m-chat v0.1.0 (C:\Users\douga\Documents2\code\RUST-projects\str0m-chat)
Finished dev [unoptimized + debuginfo] target(s) in 1m 00s
Running `target\debug\str0m-chat.exe`
error: process didn't exit successfully: `target\debug\str0m-chat.exe` (exit code: 0xc0000135, STATUS_DLL_NOT_FOUND)

That is in VC code's PowerShell terminal only. When I run cargo run in Bash (MINGW64) it runs fine. So I ran ldd in Bash and it shows me the DLLs required by the executable:

$ ldd target/debug/str0m-chat.exe
ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffb1fd10000)
KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ffb1fb70000)
KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ffb1d5f0000)
bcrypt.dll => /c/WINDOWS/System32/bcrypt.dll (0x7ffb1d410000)
ucrtbase.dll => /c/WINDOWS/System32/ucrtbase.dll (0x7ffb1dab0000)
VCRUNTIME140.dll => /c/WINDOWS/SYSTEM32/VCRUNTIME140.dll (0x7ffb03f60000)
libssl-1_1-x64.dll => /mingw64/bin/libssl-1_1-x64.dll (0x7ffb014d0000)
msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ffb1fad0000)
libcrypto-1_1-x64.dll => /mingw64/bin/libcrypto-1_1-x64.dll (0x7ffad8050000)
ADVAPI32.dll => /c/WINDOWS/System32/ADVAPI32.dll (0x7ffb1e950000)
sechost.dll => /c/WINDOWS/System32/sechost.dll (0x7ffb1fc30000)
RPCRT4.dll => /c/WINDOWS/System32/RPCRT4.dll (0x7ffb1f0c0000)
USER32.dll => /c/WINDOWS/System32/USER32.dll (0x7ffb1e7a0000)
win32u.dll => /c/WINDOWS/System32/win32u.dll (0x7ffb1da80000)
GDI32.dll => /c/WINDOWS/System32/GDI32.dll (0x7ffb1eaa0000)
gdi32full.dll => /c/WINDOWS/System32/gdi32full.dll (0x7ffb1dc50000)
msvcp_win.dll => /c/WINDOWS/System32/msvcp_win.dll (0x7ffb1dbb0000)
WS2_32.dll => /c/WINDOWS/System32/WS2_32.dll (0x7ffb1fa60000)

Two of them are in MINGW64 instead of SYSTEM32:

libssl-1_1-x64.dll => /mingw64/bin/libssl-1_1-x64.dll (0x7ffb014d0000)
libcrypto-1_1-x64.dll => /mingw64/bin/libcrypto-1_1-x64.dll (0x7ffad8050000)

So I figure this is some sort of OpenSSL install issue on Windows.

Has anyone else run into this and discovered any ways around it?

@xnorpx
Copy link
Collaborator

xnorpx commented Mar 26, 2023

https://stackoverflow.com/questions/55912871/how-to-work-with-openssl-for-rust-within-a-windows-development-environment

Should help you. I used vcpkg and set a path if I remember correctly.

@DougAnderson444
Copy link
Author

You were very right, thank you. I installed the static version of openssl using vcpkg and linked the static installation ENV vars and it now cargo run also works in Powershell too.

This is not an issue with str0m at all

Thanks again,

@algesten
Copy link
Owner

algesten commented Mar 27, 2023

Great that you solved it!

We want to remove the dependency on OpenSSL. WebRTC typically uses self-signed certificates, where the local CRL and/or root trust store is of less concern – hence tying it to the system is a lesser concern (sometimes people do use proper certificates, but this is rare).

Ideally we like to use Rustls, but that would require us to help out a bit upstream: rustls/rustls#40

There's also a second problem that the sha-1 crate doesn't work very well on windows: RustCrypto/asm-hashes#17. The asm feature is very much wanted, because one of the most expensive operations is verifying and making sha-1 sums in the SRTP packets. For now, we use OpenSSL sha-1 for windows.

So in a busy world, we are stuck with OpenSSL for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants