Skip to content

Commit

Permalink
Use julia provided cert
Browse files Browse the repository at this point in the history
  • Loading branch information
quinnj authored and JackDunnNZ committed Feb 24, 2020
1 parent 6c8f2f0 commit f459031
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ssl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ function rng!(config::SSLConfig, rng::AbstractRNG)
rng!(config, c_rng[], rng)
end

function ca_chain!(config::SSLConfig, chain=crt_parse_file(joinpath(@__DIR__, "cacert.pem")))
function ca_chain!(config::SSLConfig, chain=crt_parse_file(CERT[]))
config.chain = chain
ccall((:mbedtls_ssl_conf_ca_chain, libmbedtls), Cvoid,
(Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}),
Expand Down Expand Up @@ -749,8 +749,11 @@ end
const c_send = Ref{Ptr{Cvoid}}(C_NULL)
const c_recv = Ref{Ptr{Cvoid}}(C_NULL)
const c_dbg = Ref{Ptr{Cvoid}}(C_NULL)
const CERT = Ref{String}("")

function __sslinit__()
c_send[] = @cfunction(f_send, Cint, (Ptr{Cvoid}, Ptr{UInt8}, Csize_t))
c_recv[] = @cfunction(f_recv, Cint, (Ptr{Cvoid}, Ptr{UInt8}, Csize_t))
c_dbg[] = @cfunction(f_dbg, Cvoid, (Any, Cint, Ptr{UInt8}, Cint, Ptr{UInt8}))
CERT[] = abspath(ccall(:jl_get_julia_bindir, Any, ()), Base.DATAROOTDIR, "julia", "cert.pem")
end

0 comments on commit f459031

Please sign in to comment.