OpenSSL.jl/src/context.jl

20 lines
743 B
Julia

function set_options!(ctx::SSLContext, options::UInt32)
ccall((:SSL_CTX_set_options, libssl), Ptr{Cvoid}, (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