Help Center/ Meeting/ Client SDK Reference/ macOS SDK/ APIs/ Basic Settings/ Setting Certificate Verification Information
Updated on 2024-09-13 GMT+08:00

Setting Certificate Verification Information

setCAVerifyInfo

API Description

This API is used to set certificate verification information.

Precautions

1. This API is optional. By default, certificate verification is disabled.

Method Definition

1
- (HWMSDKERR)setCAVerifyInfo:(HWMUISDKCAVerifyInfoModel *)info;

Parameter Description

Table 1 HWMUISDKCAVerifyInfoModel description

Parameter

Mandatory

Type

Description

verifyMode

Yes

HWMUISDKVerifyMode

Verification mode.

certPath

No

NSString *

User-defined path for storing the certificate. If this parameter is left empty, the built-in certificate is used for verification.

Table 2 Enumerated values of HWMUISDKVerifyMode

Enumerated Value

Description

HWMUISDKVerifyModeNone

No verification.

HWMUISDKVerifyModeServer

Verify the server certificate.

Return Values

Whether the API is successfully called.

Sample Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
// Set certificate verification information.
HWMUISDKCAVerifyInfoModel *model = [[HWMUISDKCAVerifyInfoModel alloc] init];
model.verifyMode = getVerifyMode();
model.certPath = getCerPath();
HWMSDKERR result = [[HWMSdk getOpenApi] setCAVerifyInfo:model];
NSString *tip = @"Set";
if (result != HWMSDKSdkerrSuccess) {
  // Display a message if the setting fails.
   tip = [NSString stringWithFormat:@"Set failed[%ld]",result];
}
[HWMConsoleManager shareInstance].console = tip;