# Adding package failure due to invalid SSL certificate

**URL:** <https://discourse.julialang.org/t/adding-package-failure-due-to-invalid-ssl-certificate/37549>\
**Category:** New to Julia\
**Tags:** package\
**Created:** [April 14, 2020, 6:04am UTC](https://discourse.julialang.org/t/adding-package-failure-due-to-invalid-ssl-certificate/37549 "2020-04-14T06:04:49Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [April 14, 2020, 8:36am UTC](https://discourse.julialang.org/t/adding-package-failure-due-to-invalid-ssl-certificate/37549/5 "2020-04-14T08:36:03Z")

</div>

LibGit2 seems to ignore the configuration with

```julia
git config http.sslVerify false

```

> [@How can I force Pkg ( and LibGit2 ) to ignore SSL Verification (sslVerify)?](https://discourse.julialang.org/t/how-can-i-force-pkg-and-libgit2-to-ignore-ssl-verification-sslverify/25306):
>
> Hi, I’m behind a corporate proxy and SSL Verifications fail ( because they are MITMed ). Outside of Julia I can clone by using the corporate proxy and specifying sslVerify = false in .gitconfig. But apparently LibGit2 ignores sslVerify and instead expects the user to specify a callback. I skimmed LibGit2.jl documentation and I see that you can provide a callback but: It needs to be a pointer, I have no idea what I’m doing How do I make Pkg use it anyway Julia at work would make me happy …

and other sources.

Here

> <https://stackoverflow.com/questions/45489105/julia-certificate-error>

it is suggested to set an environment variable:

```julia
export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

```

But I think the way to go is using a callback as described here:  
[https://docs.julialang.org/en/v1/stdlib/LibGit2/#LibGit2.ProxyOptions](https://docs.julialang.org/en/v1/stdlib/LibGit2/#LibGit2.ProxyOptions)

Searching and try and error with Copy&Paste lead me to:

```julia
julia> using LibGit2

julia> function certNoCheck() return 0; end
certNoCheck (generic function with 1 method)

julia> const cb = @cfunction(certNoCheck,Cint,())
Ptr{Nothing} @0x000000002eee4c10

julia> LibGit2.ProxyOptions(certificate_cb=cb)
LibGit2.ProxyOptions(0x00000001, LibGit2.Consts.PROXY_AUTO, Cstring(0x0000000000000000), Ptr{Nothing} @0x0000000000000000, Ptr{Nothing} @0x000000002eee4c10, Ptr{Nothing} @0x0000000000000000)

```

But I have no idea if this is working at all nor if it provides the “no cert validation” for the package managers use of LibGit2.

I think if this doesn’t work, I am out of options and someone else must fill in. You may consider pinging Stefan Karpinski (Author of Pkg3). @(delete space to ping)StefanKarpinski

---

_[View the full topic](https://discourse.julialang.org/t/adding-package-failure-due-to-invalid-ssl-certificate/37549)._
