Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MbedTLS cert.perm is not packaged #710

Closed
KwatMDPhD opened this issue Aug 5, 2022 · 3 comments
Closed

MbedTLS cert.perm is not packaged #710

KwatMDPhD opened this issue Aug 5, 2022 · 3 comments

Comments

@KwatMDPhD
Copy link

KwatMDPhD commented Aug 5, 2022

JuliaLang/MbedTLS.jl#219 (comment)

@KristofferC

@thazhemadam
Copy link
Member

Just ran into this myself. Posting stack trace, MWE reproducer and versioninfo() for sake of completeness.

Stacktrace

~ ❯ MyMbedTLSApp/bin/MyMbedTLS
fatal: error thrown and no exception handler available.
InitError(mod=:MbedTLS, error=Base.SystemError(prefix="opening file "/home/zephyr/MyMbedTLSApp/share/julia/cert.pem"", errnum=2, extrainfo=nothing))
#systemerror#81 at ./error.jl:176
systemerror##kw at ./error.jl:176
systemerror##kw at ./error.jl:176
#systemerror#80 at ./error.jl:175 [inlined]
systemerror at ./error.jl:175 [inlined]
#open#670 at ./iostream.jl:293
open at ./iostream.jl:275 [inlined]
#open#378 at ./io.jl:382
open at ./io.jl:381 [inlined]
read at ./io.jl:462 [inlined]
__sslinit__ at /home/zephyr/.julia/packages/MbedTLS/F2OjD/src/ssl.jl:807
__init__ at /home/zephyr/.julia/packages/MbedTLS/F2OjD/src/MbedTLS.jl:55
jfptr___init___40849.clone_1 at /home/zephyr/MyMbedTLSApp/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-8/src/gf.c:2358 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-8/src/gf.c:2540
jl_apply at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-8/src/julia.h:1838 [inlined]
jl_module_run_initializer at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-8/src/toplevel.c:75
_finish_julia_init at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-8/src/init.c:763
julia_init at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-8/src/init.c:697
ijl_init_with_image at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-8/src/jlapi.c:74 [inlined]
ijl_init_with_image at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-8/src/jlapi.c:63
ijl_init at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-8/src/jlapi.c:90
main at MyMbedTLSApp/bin/MyMbedTLS (unknown line)

Reproducer

julia> using Pkg, PackageCompiler;
julia> Pkg.generate("MyMbedTLS");
julia> Pkg.activate("MyMbedTLS");
julia> Pkg.add("MbedTLS");
julia> open("MyMbedTLS/src/MyMbedTLS.jl", "w") do io
           write(io,
       """
       module MyMbedTLS

       function julia_main()::Cint
           @info "Hello World!"
           return 0
       end

       end
       """
       )
       end
julia> create_app("MyMbedTLS", "MyMbedTLSApp");
julia> exit()
~ ❯ MyMbedTLSApp/bin/MyMbedTLS # from a normal shell
[error stacktrace gets displayed]

Version Info

julia> versioninfo()
Julia Version 1.8.0-rc3
Commit 33f19bcbd25 (2022-07-13 19:10 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 12 × Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, skylake)
  Threads: 10 on 12 virtual cores

@KwatMDPhD
Copy link
Author

Screen Shot 2022-08-08 at 09 18 45

I tested the fix (9fb67a1) from @KristofferC and it works.

#711

Please merge this @KristofferC .

@xgdgsc
Copy link

xgdgsc commented Jun 23, 2023

When used after building a shared library, it seems to try to find the cert.pem file from the relative path to the Cpp main executable that loads this library, instead of relative to the julia lib path. Don' t know if it is easy to fix. Currently adding a symlink works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants