add sni support

master
nixo 2020-11-01 19:20:57 +01:00
parent 9c911bf2f2
commit ee83c67479
1 changed files with 7 additions and 0 deletions

View File

@ -37,3 +37,10 @@ shutdown(client::SSLClient) =
ccall((:SSL_shutdown, libssl), Cint, (Ptr{Cvoid},), client.ssl)
free(client::SSLClient) = ccall((:SSL_free, libssl), Cint, (Ptr{Cvoid},), client.ssl)
const TLSEXT_NAMETYPE_host_name = 0
set_host_name(client::SSLClient, name::String) =
ccall((:SSL_ctrl, libssl), Cint, (Ptr{Cvoid}, Cint, Cint, Cstring),
client.ssl, SSL_CTRL_SET_TLSEXT_HOSTNAME, TLSEXT_NAMETYPE_host_name, name)