【发布时间】:2021-05-08 02:11:08
【问题描述】:
您知道在 react-native 应用中如何正确地使用 自签名认证 进行 fetch 调用 吗?
使用经典抓取:
TypeError: Request failed
使用rn-fetch-blob 获取:
[Error: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.]
一个正常工作的解决方案是忽略认证,但这当然不安全。
此代码位于index.js 文件应用程序中。
const Fetch = RNFetchBlob.polyfill.Fetch
window.fetch = new Fetch({
trusty: true
}).build()
我查看了另一个帖子,例如 this!
【问题讨论】:
标签: react-native ssl fetch self-signed-certificate rn-fetch-blob