# Downloading maps using OSM in Agents.jl. OpenSSLError

**URL:** <https://discourse.julialang.org/t/downloading-maps-using-osm-in-agents-jl-opensslerror/135751>\
**Category:** Modelling & Simulations\
**Tags:** agents, osm\
**Created:** [February 20, 2026, 12:56pm UTC](https://discourse.julialang.org/t/downloading-maps-using-osm-in-agents-jl-opensslerror/135751 "2026-02-20T12:56:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Magnus\_Lilledahl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/magnus_lilledahl/32/51079_2.png) [@Magnus\_Lilledahl](https://discourse.julialang.org/u/Magnus_Lilledahl)\
**Post date:** [February 20, 2026, 12:56pm UTC](https://discourse.julialang.org/t/downloading-maps-using-osm-in-agents-jl-opensslerror/135751/1 "2026-02-20T12:56:30Z")

</div>

I am trying to use the OSM module og Agents.jl to download maps from openstreetmaps. With the following MWE

```julia-auto
using Agents

map_path = OSM.download_osm_network(:place_name;
        place_name = "Trondheim",
        network_type = :drive,
        save_to_file_location = "trondheim.json"
    )

```

I get the error

```julia-auto
ERROR: LoadError: HTTP.ConnectError for url = `https://nominatim.openstreetmap.org/search?polygon_geojson=1&format=json&dedupe=0&q=Trondheim&limit=5`: OpenSSL.OpenSSLError("unable to get local issuer certificate")

```

Top of the call stack (it was very long…):

```julia-auto
caused by: OpenSSL.OpenSSLError("unable to get local issuer certificate")
Stacktrace:
  [1] macro expansion
    @ C:\Users\magnusl\.julia\packages\OpenSSL\2SUGA\src\ssl.jl:532 [inlined]
  [2] macro expansion
    @ .\lock.jl:273 [inlined]
  [3] connect(ssl::OpenSSL.SSLStream; require_ssl_verification::Bool)
    @ OpenSSL C:\Users\magnusl\.julia\packages\OpenSSL\2SUGA\src\ssl.jl:525
  [4] connect
    @ C:\Users\magnusl\.julia\packages\OpenSSL\2SUGA\src\ssl.jl:509 [inlined]
  [5] #sslconnection#19
    @ C:\Users\magnusl\.julia\packages\HTTP\ShTJs\src\Connections.jl:599 [inlined]
  [6] sslconnection
    @ C:\Users\magnusl\.julia\packages\HTTP\ShTJs\src\Connections.jl:589 [inlined]
  [7] getconnection(::Type{…}, host::SubString{…}, port::SubString{…}; kw::@Kwargs{…})
    @ HTTP.Connections C:\Users\magnusl\.julia\packages\HTTP\ShTJs\src\Connections.jl:586
...

```

I am not very knowledgable about ssl or how Julia handles this so any pointers would be appreciated.

---

<div class="post-metadata">

**Author:** ![TZ.Neumann](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tz.neumann/32/34438_2.png) [@TZ.Neumann](https://discourse.julialang.org/u/TZ.Neumann)\
**Post date:** [February 20, 2026, 4:17pm UTC](https://discourse.julialang.org/t/downloading-maps-using-osm-in-agents-jl-opensslerror/135751/2 "2026-02-20T16:17:58Z")

</div>

Nothing wrong with your code. The problem is the external OSM server overloaded; wait a few minute and rerun the code. Once you get the file successfull, keep and reuse it in later runs instead of calling `download_osm_network` each time.

```bash
julia> map_path = OSM.download_osm_network(:place_name;
        place_name = "Trondheim",
        network_type= :drive,
        save_to_file_location= "trondheim.json")
[ Info: Using Polygon for Trondheim, Trøndelag, Norge
[ Info: Overpass server is available for download
[Info: Downloaded osm network data from ["place_name: Trondheim"] in json format
[ Info: Saved osm network data to disk: trondheim.json
Dict{String, Any} with 4 entries:
  "elements" => Any[Dict{String, Any}("id"=>0, "tags"=>Dict{String, Any}("nodes"=>"67965", "total"=>"74925", "ways"=>"6886", "relations"=>"74"), "type"=>"count"), Dic…
  "generator" => "Overpass API 0.7.62.10 2d4cfc48"
  "version" => 0.6
  "osm3s" => Dict{String, Any}("timestamp_osm_base"=>"2026-02-20T16:07:57Z", "copyright"=>"The data included in this document is from www.openstreetmap.org. The da…

```

---

<div class="post-metadata">

**Author:** ![Magnus\_Lilledahl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/magnus_lilledahl/32/51079_2.png) [@Magnus\_Lilledahl](https://discourse.julialang.org/u/Magnus_Lilledahl)\
**Post date:** [February 23, 2026, 9:18am UTC](https://discourse.julialang.org/t/downloading-maps-using-osm-in-agents-jl-opensslerror/135751/3 "2026-02-23T09:18:08Z")

</div>

Thanks for the reply

If I use a new version of Julia (1.12.5) and install Agents.jl (v6.2.10) downloading the maps works fine as you show above. However, if I try to install CairoMakie and OSMMakie to run the [zombie](https://juliadynamics.github.io/Agents.jl/stable/examples/zombies/) example from Agents.jl documentation in this environment, CairoMakie fails to compile after adding OSMMakie with the errror

```julia-auto
ERROR: LoadError: FieldError: type Core.TypeName has no field `mt` ...

```

When adding OSMMakie, CairoMakie (and some other packages) is downgraded from `v0.13.10 ⇒ v0.12.18`. Maybe this is the cause of the error?  
I found that using Julia v1.11.5 and then installing CairoMakie, OSMMakie and Agents (+`Pkg.update()`) resulted in working environment that would run the zombie example without any problems.  
When I then tried to run the code from the initial post(`OSM.download_osm_network()`) in this environment i get the same error as in the inital post. The only difference relevant difference I have found in the manifest is that the Julia 1.12.5 environment uses MbedTLS\_jll v2.28.1010 while the Julia 1.11.5 environment uses MbedTLS\_jll v2.28.6. I have no idea if this is relevant.  
My current plan for a workaround is to use the 1.12.5 environment to download maps and do most of the work and then switch to 1.11.5 if I need to plot with CairoMakie/OSMMakie. This might be cumbersome in the long run, though…

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [February 23, 2026, 9:40am UTC](https://discourse.julialang.org/t/downloading-maps-using-osm-in-agents-jl-opensslerror/135751/4 "2026-02-23T09:40:28Z")

</div>

Use Agents `#main` branch for now, and preface all functionality of OSM with `OSM.` such as `OSM.test_map()` and `OSM.plan_route!`. You need to be `using LightOSM` for functionality to come online. Everything is working for v7 to release but docs take too long to build. Final thing to resolve, but this wll happen friday and sunday.

---

<div class="post-metadata">

**Author:** ![Magnus\_Lilledahl](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/magnus_lilledahl/32/51079_2.png) [@Magnus\_Lilledahl](https://discourse.julialang.org/u/Magnus_Lilledahl)\
**Post date:** [February 23, 2026, 8:39pm UTC](https://discourse.julialang.org/t/downloading-maps-using-osm-in-agents-jl-opensslerror/135751/5 "2026-02-23T20:39:22Z")

</div>

Thank you for the heads up. Adding from the current main (`]add Agents.jl#main`) branch yielded no precompilation errors with CairoMakie and OSMMakie. When first running the zombie example (downloaded from main branch on github) I got this error

```julia-auto
ERROR: LoadError: Function not implemented for model of type StandardABM with space type OpenStreetMapSpace{OSMGraph{Int32, Int64, Float64}}.

```

But when adding `OSM.` in front of `move_along_route!`, `is_stationary` and `plan_route!` (as mentioned in the [changelog](https://github.com/JuliaDynamics/Agents.jl/blob/221e45632ee8d7a2f4f16f0cdb40f7a998dbc8ed/CHANGELOG.md)) in the example everything ran hunky dory. Thanks for all the help. (Maybe update the example before release? Should I put an issue about this on github?)

The code in the intial post also executed succesfully (after adding `using LightOSM`)
