我现在面临的一个问题,而试图用科尔多瓦文件传输的API,而工作灯开发服务器在运行HTTPS上传文件。
我创建了一个有效的CA证书,并把它的服务器,以及它导入到Android模拟器。
我能够登录到应用程序并下载使用文件传输API的数据,但是当我尝试使用它上传数据,我在logcat中获取以下信息。
该代码调用我们的WL应用程序执行的下载和上传实现的servlet。
11-26 09:20:27.854: E/FileTransfer(2362): {"target":"https:\/\/my-ip-address\/APP\/appServlet","source":"file:\/\/\/storage\/sdcard\/anywhere\/wilson\/app2\/it_1305\/1416946570255.jpg","http_status":0,"code":3}
11-26 09:20:27.854: E/FileTransfer(2362): java.io.IOException: Hostname 'my-ip-address' was not verified
11-26 09:20:27.854: E/FileTransfer(2362): at com.squareup.okhttp.Connection.upgradeToTls(Connection.java:146)
11-26 09:20:27.854: E/FileTransfer(2362): at com.squareup.okhttp.Connection.connect(Connection.java:106)
11-26 09:20:27.854: E/FileTransfer(2362): at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:287)
11-26 09:20:27.854: E/FileTransfer(2362): at com.squareup.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:248)
11-26 09:20:27.854: E/FileTransfer(2362): at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:197)
11-26 09:20:27.854: E/FileTransfer(2362): at com.squareup.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:383)
11-26 09:20:27.854: E/FileTransfer(2362): at com.squareup.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:127)
11-26 09:20:27.854: E/FileTransfer(2362): at com.squareup.okhttp.internal.http.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:179)
11-26 09:20:27.854: E/FileTransfer(2362): at org.apache.cordova.filetransfer.FileTransfer$1.run(FileTransfer.java:388)
11-26 09:20:27.854: E/FileTransfer(2362): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
11-26 09:20:27.854: E/FileTransfer(2362): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
11-26 09:20:27.854: E/FileTransfer(2362): at java.lang.Thread.run(Thread.java:841)
11-26 09:20:27.854: E/FileTransfer(2362): Failed after uploading 0 of 18725 bytes.