gpt4 book ai didi

react-native-ssl-pinning - 此服务器的证书无效

转载 作者:行者123 更新时间:2023-12-04 22:42:32 25 4
gpt4 key购买 nike

请帮帮我
我正在尝试使用 react-native-ssl-pinning 发出请求,但出现错误(IOS 14.2):

The certificate for this server is invalid. You might be connecting toa server that is pretending to be “https://...” which could put yourconfidential information at risk.


我将 .cer 证书复制到 xcode 中并执行以下操作:
const response = await fetch(url, {
method: 'POST',
body: body,
pkPinning: true,
disableAllSecurity: false,
// your certificates array (needed only in android) ios will pick it automatically
sslPinning: {
certs: ['my_cer_file_without_extension'], // your certificates name (without extension)
},
headers: {
Accept: 'application/json; charset=utf-8',
'Access-Control-Allow-Origin': '*',
e_platform: 'mobile',
},
});
有谁知道问题可能是什么?有任何想法吗?

最佳答案

在 iOS 中,确保将证书添加到捆绑资源中。转到构建阶段 > 复制捆绑资源 > 添加证书。

关于react-native-ssl-pinning - 此服务器的证书无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65398387/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com