# How can I add a custom ssl certificate so that HTTP.jl recognizes it by default?

**URL:** <https://discourse.julialang.org/t/how-can-i-add-a-custom-ssl-certificate-so-that-http-jl-recognizes-it-by-default/97698>\
**Category:** General Usage\
**Tags:** question, http, mbedtlsjl\
**Created:** [April 20, 2023, 10:56am UTC](https://discourse.julialang.org/t/how-can-i-add-a-custom-ssl-certificate-so-that-http-jl-recognizes-it-by-default/97698 "2023-04-20T10:56:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Post date:** [April 20, 2023, 10:56am UTC](https://discourse.julialang.org/t/how-can-i-add-a-custom-ssl-certificate-so-that-http-jl-recognizes-it-by-default/97698/1 "2023-04-20T10:56:55Z")

</div>

Hi there, I spend a couple of hours without success.

Let’s assume we have the julia docker running - how can I add a custom certificate (self-signed) which my website uses so that everything is trusted correctly?

I tried to add the `my.crt` file it to `/usr/share/ca-authorities/`, and run `update-ca-certificates`.  
Unfortunately despite the documention says that such files would be implicitly included, they aren’t, but you need to add a line `my.crt` to `/etc/ca-certificates.conf`. Then `update-ca-certificates` works and also `curl` works.

Interestingly, using `Downloads.download(...)` works now too, but `HTTP.get(...)` still fails with the usual

```julia
ERROR: HTTP.Exceptions.ConnectError("https://cloud.jolin.io/jwks", Base.IOError("X509 - Certificate verification failed, e.g. CRL, CA or signature check failed", -9984))

```

So I guess, HTTP does not use `NetworkOptions.ca_roots()` but somehow hardcodes their ca certificates?  
Please any help is highly appreciated.

---

<div class="post-metadata">

**Author:** ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Post date:** [April 23, 2023, 4:01am UTC](https://discourse.julialang.org/t/how-can-i-add-a-custom-ssl-certificate-so-that-http-jl-recognizes-it-by-default/97698/2 "2023-04-23T04:01:40Z")

</div>

I think the simplest way to do this is by setting the `HTTP_CA_BUNDLE` file (you can also set `CURL_CA_BUNDLE` which will be similarly recognized).
