Closed fengyankisters closed 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
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
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