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

How to use cohttp-lwt-unix on Windows 10 (cygwin) #975

Closed
whoek opened this issue Feb 28, 2023 · 2 comments
Closed

How to use cohttp-lwt-unix on Windows 10 (cygwin) #975

whoek opened this issue Feb 28, 2023 · 2 comments

Comments

@whoek
Copy link

whoek commented Feb 28, 2023

THIS IS NOT A BUG REPORT BUT A QUESTION ON LIBRARY USAGE ON WINDOWS

Question on issue with cohttp-lwt-unix on Windows 10 (cygwin): I am (was) using cohttp-lwt-unix to pull data from a https API. After a recent failed opam upgrade, I had to re-install cohttp-lwt-unix and some other libraries, but now my program fails with following error message:

Fatal error: exception Failure("No SSL or TLS support compiled into Conduit")

I am using 4.12.0+mingw64c on Windows 10 (cygwin). Also tried re-installing cohttp-lwt-unix,tls,cohttp and some other libraries but no luck.

Observation on missing items:

This is ldd currently

C:\>ldd demo.exe
        ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7ff937cb0000)
        KERNEL32.DLL => /cygdrive/c/WINDOWS/System32/KERNEL32.DLL (0x7ff9368f0000)
        KERNELBASE.dll => /cygdrive/c/WINDOWS/System32/KERNELBASE.dll (0x7ff935440000)
        msvcrt.dll => /cygdrive/c/WINDOWS/System32/msvcrt.dll (0x7ff936dd0000)
        ADVAPI32.dll => /cygdrive/c/WINDOWS/System32/ADVAPI32.dll (0x7ff936330000)
        sechost.dll => /cygdrive/c/WINDOWS/System32/sechost.dll (0x7ff936160000)
        RPCRT4.dll => /cygdrive/c/WINDOWS/System32/RPCRT4.dll (0x7ff9369f0000)
        WS2_32.dll => /cygdrive/c/WINDOWS/System32/WS2_32.dll (0x7ff936460000)
        VERSION.dll => /cygdrive/c/WINDOWS/SYSTEM32/VERSION.dll (0x7ff92e160000)

This was results of ldd a few days ago when everything was working OK

C:\>ldd demo.exe
	ntdll.dll => /cygdrive/c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffb45050000)
	KERNEL32.DLL => /cygdrive/c/WINDOWS/System32/KERNEL32.DLL (0x7ffb441e0000)
	KERNELBASE.dll => /cygdrive/c/WINDOWS/System32/KERNELBASE.dll (0x7ffb42bb0000)
	msvcrt.dll => /cygdrive/c/WINDOWS/System32/msvcrt.dll (0x7ffb44f70000)
	ADVAPI32.dll => /cygdrive/c/WINDOWS/System32/ADVAPI32.dll (0x7ffb44d90000)
	sechost.dll => /cygdrive/c/WINDOWS/System32/sechost.dll (0x7ffb44cc0000)
	RPCRT4.dll => /cygdrive/c/WINDOWS/System32/RPCRT4.dll (0x7ffb44e40000)
	bcrypt.dll => /cygdrive/c/WINDOWS/System32/bcrypt.dll (0x7ffb42e90000)
	CRYPT32.dll => /cygdrive/c/WINDOWS/System32/CRYPT32.dll (0x7ffb42950000)
	ucrtbase.dll => /cygdrive/c/WINDOWS/System32/ucrtbase.dll (0x7ffb42850000)
	WS2_32.dll => /cygdrive/c/WINDOWS/System32/WS2_32.dll (0x7ffb432c0000)
	VERSION.dll => /cygdrive/c/WINDOWS/SYSTEM32/VERSION.dll (0x7ffb37850000)

Note the following 3 are missing currently -- it is not helping me, but thought it might be of help.

	bcrypt.dll => /cygdrive/c/WINDOWS/System32/bcrypt.dll (0x7ffb42e90000)
	CRYPT32.dll => /cygdrive/c/WINDOWS/System32/CRYPT32.dll (0x7ffb42950000)
	ucrtbase.dll => /cygdrive/c/WINDOWS/System32/ucrtbase.dll (0x7ffb42850000)

Any idea on which opam library might be missing / what to do next.

A sample test program here: https://github.com/whoek/ocaml-https-demo

SIDE NOTE: What is good practice before running opam upgrade and loosing libraries if errors? Do I make a copy of my working opam switch before upgrading? (and how?)

Many Thanks
Willem

@avsm
Copy link
Member

avsm commented Mar 1, 2023

Could you try opam install tls-lwt and see if you get it working? There was a change in tls.0.16.0 to switch the subpackage needed for TLS support in Conduit into the new package, which is indeed confusing for end users of the package. Discussion on that is here mirage/ocaml-conduit#420

@whoek
Copy link
Author

whoek commented Mar 1, 2023

@avsm YES -- it worked - thank you very much for responding.

@whoek whoek closed this as completed Mar 1, 2023
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

2 participants