0

我正在尝试FileTransfer.upload()使用 Cordova 1.8.1 测试具有自签名证书的测试服务器

以下代码在 Android 上运行良好,但在 iOS 上运行不正常。

var debug = true;
var uploadurl = "https://my.host.com/upload/file/here";
ft.upload(nImageURI, uploadurl, win2, fail, options, debug);

debug=true上传方法中的一个未记录的调试功能

我仅在 iOS 上收到以下错误。安卓运行良好。

FileTransferError {
code = 3;
"http_status" = 0;
source = "https://my.host.com/upload/file/here";
target = "file:///var/mobile/Applications/1124016F-4FEE-400E-9AF1-2E2195EED1AF/myApp.app/www/index.html";
}
File Transfer Error: The certificate for this server is invalid. You might be connecting to a server that is pretending to be ‚Äúhttps://my.host.com/upload/file/hereÄù which could put your confidential information 
4

1 回答 1

4

也许您需要将白名单添加到 phonegap.plist (cordova.plist)。按照此链接中的说明进行操作。

于 2012-12-07T11:45:51.020 回答