25 lines
866 B
Julia
25 lines
866 B
Julia
function set_options!(ctx::SSLContext, options::UInt32)
|
|
ccall((:SSL_CTX_set_options, libssl), Clong, (Ptr{Cvoid}, Clong),
|
|
ctx.ptr, options)
|
|
nothing
|
|
end
|
|
|
|
function set_verify_mode(ctx::SSLContext, mode, callback = C_NULL)
|
|
ccall((:SSL_CTX_set_verify, libssl), Cvoid, (Ptr{Cvoid}, Cint, Ptr{Cvoid}),
|
|
ctx.ptr, mode, callback)
|
|
end
|
|
|
|
post_handshake_auth(ctx::SSLContext; enable::Bool = true) =
|
|
ccall((:SSL_CTX_set_post_handshake_auth, libssl), Cvoid, (Ptr{Cvoid}, Cint), ctx.ptr, enable ? 1 : 0)
|
|
|
|
function set_verify_callback(ctx::SSLContext, callback)
|
|
args = C_NULL
|
|
ccall((:SSL_CTX_set_cert_verify_callback, libssl), Cvoid,
|
|
(Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cvoid}), ctx.ptr, callback, args)
|
|
end
|
|
|
|
free(ctx::SSLContext) = ccall((:SSL_CTX_free, libssl), Cvoid, (Ptr{Cvoid},), ctx.ptr)
|
|
|
|
# TODO:
|
|
# SSL_CTX_load_verify_locations
|