# How to fix SSL cert issues in Pkg

**URL:** <https://discourse.julialang.org/t/how-to-fix-ssl-cert-issues-in-pkg/115495>\
**Category:** General Usage\
**Created:** [June 11, 2024, 4:34pm UTC](https://discourse.julialang.org/t/how-to-fix-ssl-cert-issues-in-pkg/115495 "2024-06-11T16:34:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![musm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/musm/32/3675_2.png) [@musm](https://discourse.julialang.org/u/musm)\
**Post date:** [June 11, 2024, 4:34pm UTC](https://discourse.julialang.org/t/how-to-fix-ssl-cert-issues-in-pkg/115495/1 "2024-06-11T16:34:35Z")

</div>

It seems like there is a clash between the SSL environment variable set by miniconda and the one that Julia is using.

I’ve tried setting `JULIA_SSL_CA_ROOTS_PATH=""` as suggested however the error persists.

```julia
❯ $env:SSL_CERT_FILE
C:\Users\Mus\miniconda3\Library\ssl\cacert.pem

❯ julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.10.4 (2024-06-04)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

(@v1.10) pkg> up
┌ Error: curl_easy_setopt: 4
└ @ Downloads.Curl C:\Users\Mus\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Downloads\src\Curl\utils.jl:50
    Updating registry at `C:\Users\Mus\.julia\registries\General.toml`
┌ Error: curl_easy_setopt: 4
└ @ Downloads.Curl C:\Users\Mus\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Downloads\src\Curl\utils.jl:50
  No Changes to `C:\Users\Mus\.julia\environments\v1.10\Project.toml`
  No Changes to `C:\Users\Mus\.julia\environments\v1.10\Manifest.toml`

(@v1.10) pkg> add MATLAB#Master
     Cloning git-repo `https://github.com/JuliaInterop/MATLAB.jl.git`
ERROR: failed to clone from https://github.com/JuliaInterop/MATLAB.jl.git, error: GitError(Code:ERROR, Class:SSL, 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 SSL_CERT_FILE 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.)

```

---

<div class="post-metadata">

**Author:** ![musm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/musm/32/3675_2.png) [@musm](https://discourse.julialang.org/u/musm)\
**Post date:** [June 13, 2024, 6:57pm UTC](https://discourse.julialang.org/t/how-to-fix-ssl-cert-issues-in-pkg/115495/2 "2024-06-13T18:57:53Z")

</div>

I think the issue might be that miniconda sets:

```julia
❯ $env:SSL_CERT_FILE
C:\Users\Mus\miniconda3\Library\ssl\cacert.pem

```

Is there a way to get Julia to ignore the SSL\_CERT\_DIR/SSL\_CERT\_FILE environment variables?

EDIT: still failing even after upsetting that environment variable

---

<div class="post-metadata">

**Author:** ![anthony\_827](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@anthony\_827](https://discourse.julialang.org/u/anthony_827)\
**Post date:** [July 11, 2024, 6:27am UTC](https://discourse.julialang.org/t/how-to-fix-ssl-cert-issues-in-pkg/115495/3 "2024-07-11T06:27:59Z")

</div>

I struggled with this for a while, and found that _removing_ environment variables:

- SSL\_CERT\_FILE
- JULIA\_SSL\_CA\_ROOTS\_PATH  
made things work. At the windows powershell prompt, these can be removed manually (and temporarily, for testing) with:  
Remove-Item Env:SSL\_CERT\_FILE  
Remove-Item Env:JULIA\_SSL\_CA\_ROOTS\_PATH  
If you find this works, you can then remove them from your personal environment variables.

---

<div class="post-metadata">

**Author:** ![bjarthur](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bjarthur/32/9638_2.png) [@bjarthur](https://discourse.julialang.org/u/bjarthur)\
**Post date:** [December 13, 2024, 11:35pm UTC](https://discourse.julialang.org/t/how-to-fix-ssl-cert-issues-in-pkg/115495/4 "2024-12-13T23:35:03Z")

</div>

for me i had to remove SSL\_CERT\_DIR instead of SSL\_CERT\_FILE on windows 10, julia 1.11.2. so like this in powershell:

```julia
Remove-Item Env:SSL_CERT_DIR
Remove-Item Env:JULIA_SSL_CA_ROOTS_PATH

```

---

<div class="post-metadata">

**Author:** ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)\
**Post date:** [December 14, 2024, 10:05pm UTC](https://discourse.julialang.org/t/how-to-fix-ssl-cert-issues-in-pkg/115495/5 "2024-12-14T22:05:19Z")

</div>

Indeed the conda openssl activation script sets SSL\_CERT\_DIR to an empty directory, which Julia doesn’t like. So unsetting SSL\_CERT\_DIR before launching julia will help, though I hope such a workaround won’t be needed in the future.

The issue to track is [`curl_easy_setopt: 4` when using Pkg · Issue #244 · JuliaLang/Downloads.jl](https://github.com/JuliaLang/Downloads.jl/issues/244).

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [December 14, 2024, 10:26pm UTC](https://discourse.julialang.org/t/how-to-fix-ssl-cert-issues-in-pkg/115495/6 "2024-12-14T22:26:32Z")

</div>

> [@musm](#):
>
> Is there a way to get Julia to ignore the SSL\_CERT\_DIR/SSL\_CERT\_FILE environment variables?

Yes, by setting the Julia-specific variable to the empty string.

---

<div class="post-metadata">

**Author:** ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)\
**Post date:** [December 14, 2024, 11:20pm UTC](https://discourse.julialang.org/t/how-to-fix-ssl-cert-issues-in-pkg/115495/7 "2024-12-14T23:20:36Z")

</div>

Hmm, in the OP it states that setting JULIA\_SSL\_CA\_ROOTS\_PATH to the empty string doesn’t work, and I found the same thing.

I just learned that PowerShell unsets an env var if you set it to the empty string:

```julia
❯ $Env:JULIA_SSL_CA_ROOTS_PATH = ""

julia> ENV["JULIA_SSL_CA_ROOTS_PATH"]
ERROR: KeyError: key "JULIA_SSL_CA_ROOTS_PATH" not found

```

Here it is checked for the empty string: [NetworkOptions.jl/src/ca\_roots.jl at master · JuliaLang/NetworkOptions.jl](https://github.com/JuliaLang/NetworkOptions.jl/blob/8eec5cb0acec4591e6db3c017f7499426cd8e352/src/ca_roots.jl#L121)

---

<div class="post-metadata">

**Author:** ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)\
**Post date:** [January 22, 2025, 4:09pm UTC](https://discourse.julialang.org/t/how-to-fix-ssl-cert-issues-in-pkg/115495/8 "2025-01-22T16:09:59Z")

</div>

Just updating to mention the JULIA\_SSL\_CA\_ROOTS\_PATH workarounds wouldn’t be needed anymore if these PRs are merged:

- [Search SSL\_CERT\_FILE before SSL\_CERT\_DIR by visr · Pull Request #37 · JuliaLang/NetworkOptions.jl](https://github.com/JuliaLang/NetworkOptions.jl/pull/37)
- [Don’t error when initializing LibGit2 with CA roots path by visr · Pull Request #56924 · JuliaLang/julia](https://github.com/JuliaLang/julia/pull/56924)

---

<div class="post-metadata">

**Author:** ![alex180500](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alex180500/32/44358_2.png) [@alex180500](https://discourse.julialang.org/u/alex180500)\
**Post date:** [July 27, 2025, 3:36pm UTC](https://discourse.julialang.org/t/how-to-fix-ssl-cert-issues-in-pkg/115495/9 "2025-07-27T15:36:04Z")

</div>

When does this get merged? 1.12? 1.11.7?

---

<div class="post-metadata">

**Author:** ![visr](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/visr/32/17204_2.png) [@visr](https://discourse.julialang.org/u/visr)\
**Post date:** [July 27, 2025, 4:52pm UTC](https://discourse.julialang.org/t/how-to-fix-ssl-cert-issues-in-pkg/115495/10 "2025-07-27T16:52:39Z")

</div>

The NetworkOptions.jl PR is available from 1.12-rc1. The LibGit2 fix is is already out since 1.10.10 and 1.11.5.
