Disabling SSL Verification on std.net.curl

Jack via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 16 03:18:55 PDT 2014


On Friday, 16 May 2014 at 07:37:33 UTC, Mengu wrote:
>
> hi Jack
>
> curl has an option called SSL_VERIFYPEER which is supported by 
> etc.c.curl: CurlOption.
>
> you can simply do the following:
>
> import std.stdio;
> import etc.c.curl : CurlOption;
> import std.net.curl;
>
> void main()
> {
>   auto conn = HTTP();
>   conn.handle.set(CurlOption.ssl_verifypeer, 0);
>   writeln(get("https://dlang.org/", conn));
> }
>
>
> if you set the option to 1 you will receive this error: 
> std.net.curl.CurlException at std/net/curl.d(3592): Peer 
> certificate cannot be authenticated with given CA certificates 
> on handle 7F908C01DC00

Never really knew that the C interface of curl had the option. 
Thanks for the info ..


More information about the Digitalmars-d-learn mailing list