Pure-D / serve-d

D LSP server (dlang language server protocol server)
MIT License
208 stars 49 forks source link

Fixed dcd download error #54

Closed jp-pulga closed 5 years ago

jp-pulga commented 5 years ago

Fixes the download error reported in https://github.com/Pure-D/serve-d/issues/53#issuecomment-454334628

Installing DCD
Downloading from https://github.com/dlang-community/DCD/releases/download/v0.10.2/dcd-v0.10.2-windows-x86.zip to C:\Users\João Paulo\AppData\Roaming\code-d\bin
Failed installing: std.net.curl.CurlException@std\net\curl.d(4365): Peer certificate cannot be authenticated with given CA certificates on handle 1A72960
----------------
0x00D6DB87 in std.exception.bailOut!(std.net.curl.CurlException).bailOut at C:\D\dmd2\windows\bin\..\..\src\phobos\std\exception.d(515)
0x00D66C9A in std.exception.enforce!(std.net.curl.CurlException).enforce!bool.enforce at C:\D\dmd2\windows\bin\..\..\src\phobos\std\exception.d(437)
0x00DB07B6 in void std.net.curl.Curl._check(int)
0x0096143F in std.net.curl.download!(std.net.curl.HTTP).download at C:\D\dmd2\windows\bin\..\..\src\phobos\std\net\curl.d(431)
0x009611EC in std.net.curl.download!(std.net.curl.AutoProtocol).download at C:\D\dmd2\windows\bin\..\..\src\phobos\std\net\curl.d(440)
0x0094F3D7 in served.commands.dcd_update.updateDCD at C:\Temp\serve-d\source\served\commands\dcd_update.d(113)
0x0091C848 in std.functional.DelegateFaker!(void function()).DelegateFaker.doIt at C:\D\dmd2\windows\bin\..\..\src\phobos\std\functional.d-mixin-1430(1442)
0x00D8465D in void core.thread.Fiber.run()
WebFreak001 commented 5 years ago

this is not a good solution, I don't want to ignore SSL problems for an executable file I download and execute on the users computer.

I think I will need to switch away from curl instead, maybe add vibe-core and vibe.d:http and replace the current custom fiber system, though it will add a lot of dependencies again.

jp-pulga commented 5 years ago

This may help https://curl.haxx.se/docs/sslcerts.html

WebFreak001 commented 5 years ago

https://curl.haxx.se/libcurl/c/cacertinmem.html + https://curl.haxx.se/docs/caextract.html is probably the way to go

but right now the curl wrapper in D doesn't even provide this functionality. What I could also try is the requests library

jp-pulga commented 5 years ago

The requests library seems to be the way for now.