Home > Back-end >  How to disable security certificate check with Julia's Downloads.jl?
How to disable security certificate check with Julia's Downloads.jl?

Time:10-22

In Python, I can run

import requests
url = "https://www.cij.gov.ar/d/sentencia-SGU-afb60c47-0de3-4e3f-869f-ff0d4abcb1a8.pdf"
requests.get(url, verify = False)

in order to bypass the missing certificate exception.

However, running Downloads.download("https://www.cij.gov.ar/d/sentencia-SGU-afb60c47-0de3-4e3f-869f-ff0d4abcb1a8.pdf") raises ERROR: Cert verify failed: BADCERT_NOT_TRUSTED while requesting.

Is there a way to disable the check in Julia as well?

(If the answer involves toggling some environmental variables, I'm looking to doing this within the VSCODE Julia extension, which doesn't always look at the same variables as the regular REPL...)

CodePudding user response:

The problem is that server's SSL is low quality, though most browsers take it, and Python apparently does. It has an incomplete chain:

https://www.ssllabs.com/ssltest/analyze.html?d=www.cij.gov.ar&latest

Perhaps you could install the site's certificates directly on your machine as trusted, so curl does not forbid it. I don't know why curl, which is what download,jl uses, is set to forbid grade B connections though.

CodePudding user response:

You can use HTTP.jl (I use an url which has broken certificate - your example seems to have a valid one):

val = HTTP.get("https://self-signed.badssl.com/", require_ssl_verification=false)

now val.body contains all bytes you need and you can save the to file.

  • Related