Pkg and ssl certificates on Julia 0.7

Hello,

I am trying to use Julia 0.7 from behind a firewall on Linux. In addition, the system resign’s SSL certificates. In Julia 0.6, I was able to use an environment variable SSL_CERT_FILE to point to a local certificate bundle. Once I had SSL_CERT_FILE set properly, I was able to successfully use Pkg commands on Julia 0.6. However this is not the case for Julia 0.7. In Julia 0.7 I get an error even when SSL_CERT_FILE is set. Here is the error:

(v0.7) pkg> add LightXML
   Cloning default registries into /home/sam/.julia/registries
   Cloning registry General from "https://github.com/JuliaRegistries/General.git"
ERROR: failed to clone from https://github.com/JuliaRegistries/General.git, error: GitError(Code:ERROR, Class:SSL, SSL error: 0xffff8d80 - SSL - The connection indicated an EOF)

Has anyone else experienced this, or have solution? I did see various related topics on Discorse and GitHub, but I wasn’t able to use those to help solve my problem.

Does a normal LibGit2.clone("https://github.com/JuliaRegistries/General.git", "General") work?

Thanks very much for your reply. I get the same error. In particular:

 LibGit2.clone("https://github.com/JuliaRegistries/General.git", "General")

gives

ERROR: GitError(Code:ERROR, Class:SSL, SSL error: 0xffff8d80 - SSL - The connection indicated an EOF)

Here is the stacktrace:


Stacktrace:
 [1] clone(::String, ::String, ::LibGit2.CloneOptions) at /julia-0.7.0/usr/share/julia/stdlib/v0.7/LibGit2/src/error.jl:101
 [2] macro expansion at /julia-0.7.0/usr/share/julia/stdlib/v0.7/LibGit2/src/LibGit2.jl:587 [inlined]
 [3] macro expansion at ./gcutils.jl:87 [inlined]
 [4] #clone#134(::String, ::Bool, ::Ptr{Nothing}, ::Nothing, ::Nothing, ::Dict{Symbol,Tuple{Ptr{Nothing},Any}}, ::Function, ::String, ::String) at /julia-0.7.0/usr/share/julia/stdlib/v0.7/LibGit2/src/LibGit2.jl:577
 [5] clone(::String, ::String) at /julia-0.7.0/usr/share/julia/stdlib/v0.7/LibGit2/src/LibGit2.jl:565
 [6] top-level scope at none:0

Alright, so it isn’t the package manager itself that is doing something weird. And you are sure that you have set SSL_CERT_FILE before starting julia (ENV["SSL_CERT_FILE"] has a value).

Right, I get the following output from ENV["SSL_CERT_FILE"]:

"/etc/ssl/certs/ca-bundle.crt"

which, unless I’m going crazy[1], is the same bundle that I use successfully in Julia 0.6.

[1] which is entirely possible.

I can confirm this error with 0.7.

(v0.7) pkg> add DSP
Cloning default registries into /home/cjrj/.julia/registries
Cloning registry General from "https://github.com/JuliaRegistries/General.git"
ERROR: failed to clone from https://github.com/JuliaRegistries/General.git, error: GitError(Code:ERROR, Class:SSL, SSL error: 0xffff8d80 - SSL - The connection indicated an EOF)

On 0.6.4, I had the set environment variables
SSL_CERT_FILE
and
REQUESTS_CA_BUNDLE
to point to my trusted certificate chain and
julia> Pkg.Pkg.add()
works fine as of today on 0.6.4.

Any help would be greatly appreciated for Julia 0.7!

For what it is worth, I am now working around this problem by cloning “GitHub - JuliaRegistries/General: The official registry of general Julia packages” into the registries folder from the Linux command-line (e.g. Bash):

git clone https://github.com/JuliaRegistries/General.git

Then, from Julia I can use the various Pkg commands, but where the following, hopefully harmless, warning is printed:

Updating git-repo `https://github.com/JuliaRegistries/General.git`
? Warning: Some registries failed to update:
?     ? myhome/.julia/registries/General ? failed to fetch from repo
?     ? myhome/.julia/registries/General ? failed to fetch from repo
? @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:144

Then, I need to, periodically, do a git pull on the General repository to make sure I have the latest versions of packages.

1 Like

Hello,

I am getting the same problem since a few days, both on julia 1.0.2 and julia 1.0.3.

When I try to update using

] up

I get

type or paste code hereWarning: Some registries failed to update:
│     — /home/my_username/.julia/registries/General — failed to fetch from repo
└ @ Pkg.API /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:157

Same happens when I try to install a package, however I am able to install it after a few seconds of hanging.

julia> LibGit2.clone("https://github.com/JuliaRegistries/General.git", "General")
ERROR: GitError(Code:ERROR, Class:SSL, SSL error: 0xffff8d80 - SSL - The connection indicated an EOF)
Stacktrace:
 [1] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LibGit2/src/error.jl:101 [inlined]
 [2] clone(::String, ::String, ::LibGit2.CloneOptions) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LibGit2/src/repository.jl:459
 [3] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LibGit2/src/LibGit2.jl:580 [inlined]
 [4] macro expansion at ./gcutils.jl:87 [inlined]
 [5] #clone#131(::String, ::Bool, ::Ptr{Nothing}, ::Nothing, ::Dict{Symbol,Tuple{Ptr{Nothing},Any}}, ::Function, ::String, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LibGit2/src/LibGit2.jl:570
 [6] clone(::String, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/LibGit2/src/LibGit2.jl:559
 [7] top-level scope at none:0

and

julia> ENV["SSL_CERT_FILE"]
ERROR: KeyError: key "SSL_CERT_FILE" not found
Stacktrace:
 [1] (::getfield(Base, Symbol("##417#418")))(::String) at ./env.jl:76
 [2] access_env at ./env.jl:45 [inlined]
 [3] getindex(::Base.EnvDict, ::String) at ./env.jl:76
 [4] top-level scope at none:0

I do not know if a firewall has been set up at the university level or if anything has changed, but this happens on two different computers there.

manually cloning the repository via

git pull

inside ~/.julia/registries/General works.

Do you have any tips on how to understand and solve the problem ?

Thanks in advance