www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Starting a HTTPS session with D

reply "Kadir Erdem Demir" <kerdemdemir hotmail.com> writes:
Hi

We have a network traffic logger module at office.
We need to a tool which creates simple traffic with different 
protocols and test our product's output to see if we parse the 
headers correctly or not.

And of course I proposed writing this tool with D!!!

When it comes to create a HTTP session it is very easy

auto content = get("dlang.org");

But I couldn't find any examples about https. Do I have to use a 
C library like libcurl for it. Or is there a native way do solve 
my problem.

Regards
Erdem
Feb 12 2015
parent reply "Vladimir Panteleev" <vladimir thecybershadow.net> writes:
On Thursday, 12 February 2015 at 12:11:27 UTC, Kadir Erdem Demir 
wrote:
 Hi

 We have a network traffic logger module at office.
 We need to a tool which creates simple traffic with different 
 protocols and test our product's output to see if we parse the 
 headers correctly or not.

 And of course I proposed writing this tool with D!!!

 When it comes to create a HTTP session it is very easy

 auto content = get("dlang.org");

 But I couldn't find any examples about https. Do I have to use 
 a C library like libcurl for it. Or is there a native way do 
 solve my problem.
No, you can keep using std.net.curl. You just need to tell curl how to verify server certificates. On Windows, if you are using the curl library included with DMD 2.066.1, curl will use the Windows certificate store. Otherwise, you need to provide a trusted CA bundle: auto http = HTTP(); http.handle.set(CurlOption.cainfo, "path/to/ca-bundle.crt"); Or, to completely disable verification: http.handle.set(CurlOption.ssl_verifypeer, false); Then: get("https://dlang.org", http);
Feb 12 2015
next sibling parent "Kadir Erdem Demir" <kerdemdemir hotmail.com> writes:
 get("https://dlang.org", http);
It works as I wanted, thanks a lot . Regards Erdem
Feb 12 2015
prev sibling parent "sigod" <sigod.mail gmail.com> writes:
On Thursday, 12 February 2015 at 12:34:21 UTC, Vladimir Panteleev 
wrote:
 On Windows, if you are using the curl library included with DMD 
 2.066.1, curl will use the Windows certificate store.
Did this changed? I use 2.068.0 and still have problems with SSL. Sorry for necroposting.
Aug 18 2015