API参考
载入中...
搜索中...
未找到
Hitls_sni

TLS SNI correlation type 更多...

Hitls_sni 的协作图:

类型定义

typedef int32_t(* HITLS_SniDealCb) (HITLS_Ctx *ctx, int *alert, void *arg)
 Set the extension prototype for the server to process Client Hello server_name.

枚举

enum  SNI_Type { HITLS_SNI_HOSTNAME_TYPE , HITLS_SNI_BUTT = 255 }
 Enumerated type for Server Name Indication (SNI) types. 更多...

函数

const char * HITLS_GetServerName (const HITLS_Ctx *ctx, const int type)
 Obtain the value of server_name before, during, or after the handshake on the client or server.\
int32_t HITLS_GetServernameType (const HITLS_Ctx *ctx)
 Obtain the server_name type before, during, or after the handshake on the client or server.
int32_t HITLS_CFG_SetServerName (HITLS_Config *config, uint8_t *serverName, uint32_t serverNameStrlen)
 Set server_name.
int32_t HITLS_CFG_GetServerName (HITLS_Config *config, uint8_t **serverName, uint32_t *serverNameStrlen)
 Obtain the value of server_name configured on the client.
int32_t HITLS_CFG_SetServerNameCb (HITLS_Config *config, HITLS_SniDealCb callback)
 Set the server_name callback function on the server, which is used for SNI negotiation, cb can be NULL.
int32_t HITLS_CFG_SetServerNameArg (HITLS_Config *config, void *arg)
 Set the server_name parameters required during SNI negotiation on the server.
int32_t HITLS_CFG_GetServerNameCb (HITLS_Config *config, HITLS_SniDealCb *callback)
 Obtain the server_name callback settings on the server.
int32_t HITLS_CFG_GetServerNameArg (HITLS_Config *config, void **arg)
 Obtain the server_name required during SNI negotiation on the server, related Parameter arg.
HITLS_ConfigHITLS_SetNewConfig (HITLS_Ctx *ctx, HITLS_Config *newConfig)
 Set a new configuration for an existing TLS handle. Currently this parameter is used only in SNI callback.

详细描述

TLS SNI correlation type

类型定义说明

◆ HITLS_SniDealCb

typedef int32_t(* HITLS_SniDealCb) (HITLS_Ctx *ctx, int *alert, void *arg)

Set the extension prototype for the server to process Client Hello server_name.

参数
ctx[IN] ctx context.
alert[IN] Warning information.
arg[IN] The server supports the input parameters related to server_name.
返回
The user return value contains: HITLS_ACCEPT_SNI_ERR_OK 0 (received, server_name null extension) HITLS_ACCEPT_SNI_ERR_ALERT_FATAL 2 (Do not accept, abort handshake) HITLS_ACCEPT_SNI_ERR_NOACK 3 (not accepted, but continue handshake, not sending server_name null extension)

枚举类型说明

◆ SNI_Type

enum SNI_Type

Enumerated type for Server Name Indication (SNI) types.

Currently, the SNI supports only the host name type.

函数说明

◆ HITLS_CFG_GetServerName()

int32_t HITLS_CFG_GetServerName ( HITLS_Config * config,
uint8_t ** serverName,
uint32_t * serverNameStrlen )

Obtain the value of server_name configured on the client.

参数
config[IN] config Context
serverName[OUT] serverName
serverNameStrlen[OUT] serverName length
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_CFG_GetServerNameArg()

int32_t HITLS_CFG_GetServerNameArg ( HITLS_Config * config,
void ** arg )

Obtain the server_name required during SNI negotiation on the server, related Parameter arg.

参数
config[IN] Config context
arg[IN] [OUT] Set parameters related to server_name.arg
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_CFG_GetServerNameCb()

int32_t HITLS_CFG_GetServerNameCb ( HITLS_Config * config,
HITLS_SniDealCb * callback )

Obtain the server_name callback settings on the server.

参数
config[IN] config Context
callback[IN] [OUT] Server callback implemented by the user
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_CFG_SetServerName()

int32_t HITLS_CFG_SetServerName ( HITLS_Config * config,
uint8_t * serverName,
uint32_t serverNameStrlen )

Set server_name.

参数
config[OUT] config Context
serverName[IN] serverName
serverNameStrlen[IN] serverName length
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_CFG_SetServerNameArg()

int32_t HITLS_CFG_SetServerNameArg ( HITLS_Config * config,
void * arg )

Set the server_name parameters required during SNI negotiation on the server.

参数
config[OUT] Config context
arg[IN] Set parameters related to server_name.
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_CFG_SetServerNameCb()

int32_t HITLS_CFG_SetServerNameCb ( HITLS_Config * config,
HITLS_SniDealCb callback )

Set the server_name callback function on the server, which is used for SNI negotiation, cb can be NULL.

参数
config[OUT] Config Context
callback[IN] Server callback implemented by the user
返回
HITLS_SUCCESS, if successful. For details about other error codes, see hitls_error.h.

◆ HITLS_GetServerName()

const char * HITLS_GetServerName ( const HITLS_Ctx * ctx,
const int type )

Obtain the value of server_name before, during, or after the handshake on the client or server.\

参数
ctx[IN] TLS connection handle
type[IN] serverName type
返回
The value of server_name, if successful. NULL, if failure.

◆ HITLS_GetServernameType()

int32_t HITLS_GetServernameType ( const HITLS_Ctx * ctx)

Obtain the server_name type before, during, or after the handshake on the client or server.

参数
ctx[IN] TLS connection handle
返回
HITLS_SNI_HOSTNAME_TYPE, if successful. -1: if failure.

◆ HITLS_SetNewConfig()

HITLS_Config * HITLS_SetNewConfig ( HITLS_Ctx * ctx,
HITLS_Config * newConfig )

Set a new configuration for an existing TLS handle. Currently this parameter is used only in SNI callback.

参数
ctx[OUT] TLS connection handle.
newConfig[IN] config Context
返回
Return the global configuration pointer currently used by the CTX, or NULL indicates that memory allocation fails.