Julia 1.6 corporate firewall `could not download https://pkg.julialang.org/registries`

I’m having trouble with a corporate MITM firewall and Julia-1.6.x, just with fetching https://pkg.julialang.org/registries.

(testing) pkg> up
    Updating registry at `~/.julia/registries/General`
┌ Warning: could not download https://pkg.julialang.org/registries
└ @ Pkg.Types /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_julia/julia/work/julia-1.6.1/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:980
julia> import Downloads

julia> Downloads.download("https://pkg.julialang.org/registries", stdout)
ERROR: SSL: certificate verification failed (result: 5) while requesting https://pkg.julialang.org/registries

On my home network, there is no error. I found other discussions about this, but my issue seems to be different. I’m on a Mac (10.15.7), and I have several things installed via macports, including curl and openssl that are first in my path. I copied my corporate cert file corporate.pem to /opt/local/etc/openssl/ and ran openssl rehash /opt/local/etc/openssl/. After that, and using export SSL_CERT_DIR="/opt/local/etc/openssl/", I get instead:

julia> import NetworkOptions

julia> NetworkOptions.ca_roots_path()
"/opt/local/etc/openssl/"
julia> import Downloads

julia> Downloads.download("https://pkg.julialang.org/registries", stdout)
┌ Error: curl_easy_setopt: 4
└ @ Downloads.Curl /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_lang_julia/julia/work/julia-1.6.1/usr/share/julia/stdlib/v1.6/Downloads/src/Curl/utils.jl:36
/registry/23338594-aafe-5451-b93e-139f81909106/4475704d0eb7b01b2ac0c1e3a3f08b98cb7ac8c8
Base.TTY(RawFD(14) open, 0 bytes waiting)

I am not able to make much of this error. But it looks like the registry was downloaded? Suggestions?

Perhaps:

ENV["JULIA_SSL_NO_VERIFY_HOSTS"] = "julialang.org"

or similar like

ENV["JULIA_SSL_NO_VERIFY_HOSTS"] = "pkg.julialang.org"

from this thread:

Yes, ENV["JULIA_SSL_NO_VERIFY_HOSTS"] = "pkg.julialang.org" does resolve the initial warning/error that I reported.

However, I think my effort to use my corporate (MITM-firewall) certs is also working but is producing spurious errors, similar to what is described here.

1 Like

I’m tagging on to the issue a little. I’ve noticed that Julia doesn’t look at my environment variables. I have to set these ENV variables every time from within Julia repl for it to work.