silkimen / cordova-plugin-advanced-http

Cordova / Phonegap plugin for communicating with HTTP servers. Allows for SSL pinning!
MIT License
391 stars 313 forks source link

[Bug] An SSL error has occurred and a secure connection to the server cannot be made #503

Closed fengyankisters closed 1 year ago

fengyankisters commented 1 year ago

Describe the bug SSL error only happens in IOS, in Adroid, it works fine.

System info

**Are you using ionic-native-wrapper? -> NO

Minum code to reproduce var getAuthUser= function(user,password) { var token = user + ":" + password; var hash = btoa(token); return "Basic " + hash; };

var url = "https://host:port/rest/0/groups/ping"; var options = { method: "GET", headers: { 'Accept': 'application/json', 'Authorization': getAuthUser("Admin","*****") } };

cordova.plugin.http.setServerTrustMode('nocheck', function(){ console.log('trust mode set success'); }, function(){ console.log('trust mode set fail'); });

cordova.plugin.http.sendRequest(url, options, function(response){ console.log('ping success') console.log(response.status); },function(response){ console.log(response.status); console.log(response.error); });

Screenshots

image

fengyankisters commented 1 year ago

Issue have been solved, the reason is the project include extra cordova-plugin-wkwebview-file-xhr which will prvent 'nocheck' mode, so the issue is invlid