You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LibGit2: improve error when CA root cert can't be set (#38827)
This also fixes an insecure behavior: even if `set_ssl_cert_locations`
failed, `REFCOUNT` was still incremented, which meant that subsequent
calls to `ensure_initialized` didn't call `initialize` and so there was
never a successful call to `set_ssl_cert_locations`. Without this
libgit2 defaults to not verifying host identities and that is insecure.
To prevent this, this patch locks on `ensure_initialized` and decrements
`REFCOUNT` if initialize throws an error, ensuring that `initialize`
succeeds at least once, including the call to `set_ssl_cert_locations`.
(cherry picked from commit 4dede6d)
err.msg =="TLS backend doesn't support certificate locations"||
1012
+
throw(err)
1013
+
var =nothing
1014
+
for v in NetworkOptions.CA_ROOTS_VARS
1015
+
haskey(ENV, v) && (var = v)
1016
+
end
1017
+
@assert var !==nothing# otherwise we shouldn't be here
1018
+
msg ="""
1019
+
Your Julia is built with a SSL/TLS engine that libgit2 doesn't know how to configure to use a file or directory of certificate authority roots, but your environment specifies one via the $var variable. If you believe your system's root certificates are safe to use, you can `export JULIA_SSL_CA_ROOTS_PATH=""` in your environment to use those instead.
0 commit comments