7 pub const TLS1_VERSION
: c_int
= 0x301;
8 pub const TLS1_1_VERSION
: c_int
= 0x302;
9 pub const TLS1_2_VERSION
: c_int
= 0x303;
10 #[cfg(any(ossl111, libressl340))]
11 pub const TLS1_3_VERSION
: c_int
= 0x304;
13 pub const TLS1_AD_DECODE_ERROR
: c_int
= 50;
14 pub const TLS1_AD_UNRECOGNIZED_NAME
: c_int
= 112;
16 pub const TLSEXT_NAMETYPE_host_name
: c_int
= 0;
17 pub const TLSEXT_STATUSTYPE_ocsp
: c_int
= 1;
19 pub unsafe fn SSL_set_tlsext_host_name(s
: *mut SSL
, name
: *mut c_char
) -> c_long
{
22 SSL_CTRL_SET_TLSEXT_HOSTNAME
,
23 TLSEXT_NAMETYPE_host_name
as c_long
,
28 pub unsafe fn SSL_set_tlsext_status_type(s
: *mut SSL
, type_
: c_int
) -> c_long
{
31 SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE
,
37 pub unsafe fn SSL_get_tlsext_status_ocsp_resp(ssl
: *mut SSL
, resp
: *mut *mut c_uchar
) -> c_long
{
40 SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP
,
46 pub unsafe fn SSL_set_tlsext_status_ocsp_resp(
53 SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP
,
59 #[deprecated(note = "use SSL_CTX_set_tlsext_servername_callback__fixed_rust instead")]
61 pub unsafe fn SSL_CTX_set_tlsext_servername_callback(
63 // FIXME should have the right signature
64 cb
: Option
<extern "C" fn()>,
66 SSL_CTX_callback_ctrl(ctx
, SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
, cb
)
69 pub unsafe fn SSL_CTX_set_tlsext_servername_callback__fixed_rust(
71 cb
: Option
<unsafe extern "C" fn(*mut SSL
, *mut c_int
, *mut c_void
) -> c_int
>,
73 SSL_CTX_callback_ctrl__fixed_rust(ctx
, SSL_CTRL_SET_TLSEXT_SERVERNAME_CB
, mem
::transmute(cb
))
76 pub const SSL_TLSEXT_ERR_OK
: c_int
= 0;
77 pub const SSL_TLSEXT_ERR_ALERT_WARNING
: c_int
= 1;
78 pub const SSL_TLSEXT_ERR_ALERT_FATAL
: c_int
= 2;
79 pub const SSL_TLSEXT_ERR_NOACK
: c_int
= 3;
81 pub unsafe fn SSL_CTX_set_tlsext_servername_arg(ctx
: *mut SSL_CTX
, arg
: *mut c_void
) -> c_long
{
82 SSL_CTX_ctrl(ctx
, SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG
, 0, arg
)
85 pub unsafe fn SSL_CTX_set_tlsext_status_cb(
87 cb
: Option
<unsafe extern "C" fn(*mut SSL
, *mut c_void
) -> c_int
>,
89 SSL_CTX_callback_ctrl__fixed_rust(ctx
, SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB
, mem
::transmute(cb
))
92 pub unsafe fn SSL_CTX_set_tlsext_status_arg(ctx
: *mut SSL_CTX
, arg
: *mut c_void
) -> c_long
{
93 SSL_CTX_ctrl(ctx
, SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG
, 0, arg
)