edicl / drakma

HTTP client written in Common Lisp
http://edicl.github.io/drakma/
249 stars 58 forks source link

cl+ssl difficulties on Windows, possible alternatives #105

Open lispstudent opened 4 years ago

lispstudent commented 4 years ago

cl+ssl has been having difficulties on Windows[1], and becasue of that, Drakma will also fail dealing with TLS resources when used on Windows.

Although Dexador also leverages cl+ssl, on Windows it will work since it uses winhttp[2].

Would it be possible for Drakma to consider using winhttp instead of cl+ssl on Windows?

A cleaner alternative, at least on Lispworks: there would be no need to use cl+ssl with Lispworks, since Lispworks has built-in SSL so CL+SSL is not necessary[3].


[1]: cl+ssl requires openssl binaries installed on your system: on Windows this will quickly become a poor experience. Binaries are scattered, it is difficult to mix and match them with a particular platform and version, and at every update it will likely break.

[2]: winhttp provides a set of cffi bindings to the WinHttp API, a fully featured HTTP client (WinHttp.dll) available on all Windows systems, no installing third party libraries is required.

[3]: See for example this MR to fix that on Dexador's side: https://github.com/fukamachi/dexador/pull/83

lispstudent commented 4 years ago

There is also the work by Frank James patching drakma. This conditionally compiles to use his schannel library on Windows rather than CL+SSL.

fjames86 commented 2 years ago

I have previously developed two alternative approaches to this problem, linked above (a high level approach by binding to winhttp, and a low level approach by using schannel API). I have developed a fork of drakma (and hunchentoot) which use schannel instead of cl+ssl. The forks are more proof of concept than the finished article. Unfortunately I don't have as much time for this as I used to, but I am willing to help integrate these patches into master. Maybe as a first attempt we could make it a compile option based on some feature flag. I think long-term it is a better option for windows users, but it is a considerable behaviour change which may surprise some.