MbedTLS error on WSL

sschmidhuber
Wed, 15 Oct 2025 14:42:04 +0000
General Usage

Hello,
I run Julia on Win 11 within WSL2 (Debian), in general without issues so far. But recently I encountered the following issue with MbedTLS, when I attempt to create a SSLConfig.

MWE

# installing MbedTLS in a clean, temporary environment
using Pkg
Pkg.activate(; temp=true)
Pkg.add("MbedTLS")
using MbedTLS

# creating a SSLConfig
MbedTLS.SSLConfig(false)

Result

ERROR: MbedTLS error code 1: ERROR - Generic error
Stacktrace:
 [1] mbed_err(ret::Int32)
   @ MbedTLS ~/.julia/packages/MbedTLS/Vaaz8/src/error.jl:17
 [2] crt_parse!
   @ ~/.julia/packages/MbedTLS/Vaaz8/src/x509_crt.jl:32 [inlined]
 [3] crt_parse
   @ ~/.julia/packages/MbedTLS/Vaaz8/src/x509_crt.jl:42 [inlined]
 [4] ca_chain!
   @ ~/.julia/packages/MbedTLS/Vaaz8/src/ssl.jl:513 [inlined]
 [5] SSLConfig(verify::Bool; log_secrets::Nothing)
   @ MbedTLS ~/.julia/packages/MbedTLS/Vaaz8/src/MbedTLS.jl:150
 [6] SSLConfig(verify::Bool)
   @ MbedTLS ~/.julia/packages/MbedTLS/Vaaz8/src/MbedTLS.jl:132
 [7] top-level scope
   @ REPL[5]:1

I have the same issue with Julia 1.12.0 and 1.10.10.
On Win 11 I don’t have the issue also on a “real” (not WSL2) Debian system I can’t reproduce the issue.

Anyone having an idea how to solve the problem on WSL2 or faced a similar challenge before?

Thank you!
Stefan

4 posts - 2 participants