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

TLS ALPN related type 更多...

Hitls_alpn 的协作图:

宏定义

#define HITLS_ALPN_ERR_OK   0 /* Correct execution. */
 HITLS ALPN ERR

类型定义

typedef int32_t(* HITLS_AlpnSelectCb) (HITLS_Ctx *ctx, uint8_t **selectedProto, uint8_t *selectedProtoSize, uint8_t *clientAlpnList, uint32_t clientAlpnListSize, void *userData)
 Callback prototype for selecting the ALPN protocol on the server, which is used to select the application layer protocol during ALPN negotiation.

函数

int32_t HITLS_CFG_SetAlpnProtos (HITLS_Config *config, const uint8_t *alpnProtos, uint32_t alpnProtosLen)
 Sets the ALPN list on the client, which is used to negotiate the application layer protocol with the server in the handshake phase.
int32_t HITLS_CFG_SetAlpnProtosSelectCb (HITLS_Config *config, HITLS_AlpnSelectCb callback, void *userData)
 Sets the ALPN selection callback on the server. The callback is used to select the application layer protocol in the handshake phase, cb can be NULL.
int32_t HITLS_SetAlpnProtos (HITLS_Ctx *ctx, const uint8_t *protos, uint32_t protosLen)
 Sets the client ALPN list, which is used to negotiate the application layer protocol with the server in the handshake phase.
int32_t HITLS_GetSelectedAlpnProto (HITLS_Ctx *ctx, uint8_t **proto, uint32_t *protoLen)
 Obtaining the ALPN Negotiation Result
int32_t HITLS_SelectAlpnProtocol (uint8_t **out, uint8_t *outLen, const uint8_t *servAlpnList, uint32_t servAlpnListLen, const uint8_t *clientAlpnList, uint32_t clientAlpnListLen)
 Obtaining the ALPN Negotiation Result The server selects an appropriate ALPN based on the ALPN provided by the client and its own configured ALPN.

详细描述

TLS ALPN related type

类型定义说明

◆ HITLS_AlpnSelectCb

typedef int32_t(* HITLS_AlpnSelectCb) (HITLS_Ctx *ctx, uint8_t **selectedProto, uint8_t *selectedProtoSize, uint8_t *clientAlpnList, uint32_t clientAlpnListSize, void *userData)

Callback prototype for selecting the ALPN protocol on the server, which is used to select the application layer protocol during ALPN negotiation.

参数
ctx[IN] Ctx context.
selectedProto[OUT] Indicates the initial IP address of the protocol that is being matched.
selectedProtoLen[OUT] Matching protocol length.
clientAlpnList[IN] Client ALPN List.
clientAlpnListSize[IN] Client ALPN List length.
userData[IN] Context transferred by the user.
返回
HITLS_ALPN_ERR_OK 0, indicates success. HITLS_ALPN_ERR_ALERT_WARNING 1, indicates send warning alert. HITLS_ALPN_ERR_ALERT_FATAL 2, indicates send fatal alert. HITLS_ALPN_ERR_NOACK 3, indicates no processing.

函数说明

◆ HITLS_CFG_SetAlpnProtos()

int32_t HITLS_CFG_SetAlpnProtos ( HITLS_Config * config,
const uint8_t * alpnProtos,
uint32_t alpnProtosLen )

Sets the ALPN list on the client, which is used to negotiate the application layer protocol with the server in the handshake phase.

参数
config[OUT] Config context.
alpnProtos[IN] Application layer protocol list.
alpnProtosLen[IN] Length of the application layer protocol list.
返回
If success, return HITLS_SUCCESS. For details about other error codes, see hitls_error.h.

◆ HITLS_CFG_SetAlpnProtosSelectCb()

int32_t HITLS_CFG_SetAlpnProtosSelectCb ( HITLS_Config * config,
HITLS_AlpnSelectCb callback,
void * userData )

Sets the ALPN selection callback on the server. The callback is used to select the application layer protocol in the handshake phase, cb can be NULL.

参数
config[OUT] Config context.
callback[IN] Server callback implemented by the user.
userData[IN] Product context.
返回
If success, return HITLS_SUCCESS. For details about other error codes, see hitls_error.h.

◆ HITLS_GetSelectedAlpnProto()

int32_t HITLS_GetSelectedAlpnProto ( HITLS_Ctx * ctx,
uint8_t ** proto,
uint32_t * protoLen )

Obtaining the ALPN Negotiation Result

参数
ctx[IN] Ctx context.
proto[OUT] Header address of the outgoing selected protocol.
protoLen[OUT] Length of the outgoing selected protocol.
返回
If success, return HITLS_SUCCESS. For details about other error codes, see hitls_error.h.

◆ HITLS_SelectAlpnProtocol()

int32_t HITLS_SelectAlpnProtocol ( uint8_t ** out,
uint8_t * outLen,
const uint8_t * servAlpnList,
uint32_t servAlpnListLen,
const uint8_t * clientAlpnList,
uint32_t clientAlpnListLen )

Obtaining the ALPN Negotiation Result The server selects an appropriate ALPN based on the ALPN provided by the client and its own configured ALPN.

参数
out[OUT] Outgoing selected protocol.
outLen[OUT] Length of the outgoing selected protocol.
servAlpnList[IN] Server Application layer protocol list.
servAlpnListLen[IN] Length of the application layer protocol list.
clientAlpnList[IN] Client Application layer protocol list.
clientAlpnListLen[IN] Length of the application layer protocol list.
返回值
HITLS_SUCCESS,succeeded.Note: Success does not necessarily mean negotiating ALPN; it requires making a judgment on "out."
HITLS_NULL_INPUT,theinput is NULL.
HITLS_CONFIG_INVALID_LENGTH,ALPNlength does not match the actual length..

◆ HITLS_SetAlpnProtos()

int32_t HITLS_SetAlpnProtos ( HITLS_Ctx * ctx,
const uint8_t * protos,
uint32_t protosLen )

Sets the client ALPN list, which is used to negotiate the application layer protocol with the server in the handshake phase.

参数
ctx[OUT] TLS connection Handle.
protos[IN] Application layer protocol list.
protosLen[IN] Length of the application layer protocol list.
返回
If success, return HITLS_SUCCESS. For details about other error codes, see hitls_error.h.