我是NativeScript的新手,所以我需要帮助iOS和安卓的旁路。我试着看谷歌,但我已经用尽了自己的努力,试图找到一个解决方案,足以满足Angular2+。
我有一个来自GoDaddy的通配符SSL证书,所以我不能使用nativescript(每个github发布的https://github.com/gethuman/nativescript-https/issues/14)。
一个真正的例子,在这里我可以阅读代码并了解发生在什么地方,我的意思是,我试着查看https://discourse.nativescript.org/t/how-to-ignore-invalid-ssl-certificate-in-nativescript/1924,但是这对我来说没有任何意义,因为我不知道在使用这个示例时从哪里开始代码。
编辑:我尝试使用本地文本-https disableSSLPining,但没有成功。在我的app.module.ts上
import * as application from 'application';
import * as platform from 'platform';
import * as HTTPS from 'nativescript-https';
var disabledSSLError = () => {
if(platform.isAndroid){
application.android.startActivity = () => {
HTTPS.disableSSLPinning();
}
}
};
disabledSSLError();但是,当我发邮件时
"message": "Http failure response for (unknown url): 0 Unknown Error",
JS: "error": {
JS: "originalStack": "Error: javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found.\n at new ZoneAwareError (file:///data/data/org.nativescript.myapp/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:1298:33)\n at onRequestComplete (file:///data/data/org.nativescript.myapp/files/app/tns_modules/tns-core-modules/http/http-request/http-request.js:45:34)\n at Object.onComplete (file:///data/data/org.nativescript.myapp/files/app/tns_modules/tns-core-modules/http/http-request/http-request.js:37:13)",https://stackoverflow.com/questions/54082975
复制相似问题