HarmonyOS 使用socket.TLSSocket进行SSL加密通信时 socket.TLSConnectOptions>secureOptions>ca 如何配置
let tlsOneWay: socket.TLSSocket = socket.constructTLSSocketInstance(); // One way authentication
tlsOneWay.bind(bindAddr, (err: BusinessError) => {
if (err) {
console.log('bind fail');
return;
}
console.log('bind success');
});
let tlsOneWayConnectOptions: socket.TLSConnectOptions = {
address: {
address: '192.168.xx.xxx',
port: 8080
},
secureOptions: {
ca: ["xxxx", "xxxx"],
cipherSuite: "AES256-SHA256"
}
}
tlsOneWay.connect(tlsOneWayConnectOptions).then(() => {
console.log("connect successfully");
}).catch((err: BusinessError) => {
console.log("connect failed " + JSON.stringify(err));
});
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
ca: [“xxxx”, “xxxx”] 具体应该如何配置
HarmonyOS
赞
收藏 0
回答 1
相关问题
HarmonyOS socket.TLSSocket发送Uint8Array对象
622浏览 • 1回复 待解决
HarmonyOS socket.TLSSocket单向认证出现2303501异常
677浏览 • 1回复 待解决
socket通信示例,创建tcp server和tcp client进行通信
1855浏览 • 1回复 待解决
HarmonyOS TLS Socket是否能直接信任ca
670浏览 • 1回复 待解决
HarmonyOS 经典蓝牙的socket通信问题
1278浏览 • 1回复 待解决
需要使用socket通信,现在用HarmonyOS无法解析消息
2505浏览 • 1回复 待解决
HarmonyOS如何退到后台时退出socket
1246浏览 • 0回复 待解决
HarmonyOS TLSSocket 单向认证,ca证书错误
908浏览 • 1回复 待解决
HarmonyOS 能否通过Socket 监听127.0.0.1实现跨进程通信
930浏览 • 1回复 待解决
HarmonyOS 关于Socket
757浏览 • 1回复 待解决
ohos.net.socket (Socket连接)链接不上
6769浏览 • 1回复 待解决
HarmonyOS Tcp socket问题
965浏览 • 1回复 待解决
HarmonyOS 如何监听蓝牙socket断开
673浏览 • 1回复 待解决
HarmonyOS Socket报缓存溢出
729浏览 • 1回复 待解决
HarmonyOS socket绑定端口失败
976浏览 • 1回复 待解决
HarmonyOS socket 绑定IP问题
801浏览 • 1回复 待解决
HarmonyOS TLSSocket建连ca入参必传问题
598浏览 • 1回复 待解决
HarmonyOS UDP socket bind失败
794浏览 • 1回复 待解决
HarmonyOS socket下的tlsOneWaySecureOption不配置是否会使用手机上的默认证书
605浏览 • 1回复 待解决
HarmonyOS socket tcp连接报错
930浏览 • 1回复 待解决
HarmonyOS socket连接失败code: 103
798浏览 • 1回复 待解决
基于TLSSocket的通信能力
1481浏览 • 1回复 待解决
socket连接NetAddress获取问题
1044浏览 • 1回复 待解决
HarmonyOS 使用socket发送数据频繁容易报2301004错误
587浏览 • 1回复 待解决
HarmonyOS 蓝牙socket.sppWrite 报错
724浏览 • 1回复 待解决
请按照下方示例再尝试一下: