Downloading files over TLS

Jacob Carlborg doob at me.com
Fri Jun 26 11:41:27 UTC 2020


On Friday, 26 June 2020 at 11:10:27 UTC, ikod wrote:

> Hello,
>
> re `requests` - it uses dlopen (and variants for OSX and 
> Windows, see 
> https://github.com/ikod/dlang-requests/blob/master/source/requests/ssl_adapter.d#L50). The reason for dlopen is simple - compatibility with both openssl ver 1.0 and 1.1 (which have incompatible interfaces). To solve this problem I expose common interface for Requests internal needs, and detect and use different underlying openssl interfaces depending on library version.

Oh, it's that bad. That's disappointing.

> I'm sure it is possible to detect library version at build 
> time, and then use static linking. It just require some time 
> investment to find most acceptable solution on how to do this.

I'm using a script (written in D) in my tool, DStep [1][2], to 
identify which versions of libclang is available and to select 
between dynamic link (not using `dlopen`) and static linking of 
libclang. It works pretty well.

> Re Windows - I'd be happy to use native SecureChannel but I 
> have zero windows programming experience. I'm completely open 
> for any help in this field.

I don't have much experience with programming on Windows either. 
macOS is my main platform.

> Bottom line - problem with SSL/TLS libraries lies in 
> incompatibility between platforms and even inside the single 
> library.

Yes. I'm trying to identify the best solution, which ideally 
requires the least amount of work.

[1] 
https://github.com/jacob-carlborg/dstep/blob/master/configure.d
[2] 
https://github.com/jacob-carlborg/dstep/blob/master/dub.json#L34-L41

--
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list