【发布时间】:2018-05-24 06:57:36
【问题描述】:
我正在尝试使用@ionic-native http 在 ionic3 中实现 SSL 固定。
我已将证书(.cer)文件复制到 platforms/android/assets 文件夹中。我尝试运行以下代码并收到错误消息:
您必须添加至少 1 个证书才能固定到证书
谁能帮助我为什么会收到此错误?
private getHtpRequest(url: string){
return new Promise((resolve, reject) => {
this.htp.enableSSLPinning(true);
this.htp.post(url, {}, {'Content-Type': 'application/json','reqId': Math.floor((Math.random() * 1000000) + 1).toString()})
.then(
(res: any) => {
this.results = res.json();
// Dismiss the loader and return response back.
resolve(this.results)
},
(error: any) => {
// Dismiss the loader and return error back.
reject(error)
}
)
});
}
【问题讨论】:
-
有人可以删除sunil的垃圾邮件吗?