Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16880] iOS: "sslerror" event for webView is not working

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2014-05-28T22:17:11.000+0000
Affected Version/sRelease 3.3.0
Fix Version/sn/a
ComponentsiOS
Labelsqe-3.3.0
ReporterPriya Agarwal
AssigneeSabil Rahim
Created2014-04-24T11:30:35.000+0000
Updated2017-03-20T20:37:37.000+0000

Description

"sslerror" event for webView is not working. Steps to reproduce: 1. Copy paste the code given below in app.js and run the app. Actual Result:
[ERROR] :  Error loading: https://certs.cac.washington.edu/CAtest/, Error: Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “certs.cac.washington.edu” which could put your confidential information at risk." UserInfo=0x15568a70 {NSErrorFailingURLStringKey=https://certs.cac.washington.edu/CAtest/, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSErrorFailingURLKey=https://certs.cac.washington.edu/CAtest/, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “certs.cac.washington.edu” which could put your confidential information at risk., NSUnderlyingError=0x15665010 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “certs.cac.washington.edu” which could put your confidential information at risk.", NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x15567f80>}
Expected Result: Must get "sslerror" in console logs as well as the webview must be loaded with webpage same as in "https://certs.cac.washington.edu/CAtest/" For Details please look into TIMOB-4488.
var window = Ti.UI.createWindow({
    backgroundColor:'#fff'
});
  
var webView = Ti.UI.createWebView({
    backgroundColor:'white',
    url:'https://certs.cac.washington.edu/CAtest/'
    });
 
webView.addEventListener('sslerror', function(evt) {
     Ti.API.info("sslerror");
     
    //Comment below line to fail
    webView.ignoreSslError = true;
});
window.add(webView);
  
window.open();

Comments

  1. Kajenthiran Velummaylum 2014-05-21

    The bug is *reproducible.* Issue is still available with the sample code provided. *Test Environment:* || *Component* || *Version* || | Appcelerator Studio | 3.3.0.201405161313 | | Titanium SDK | 3.3.0.v20140520141136 | | Alloy | 1.4.0-alpha2 | | CLI | 3.3.0-alpha4 | | ACS | 1.0.14 | | NPM | 1.4.10 | | Titanium-Code-Processor | 1.1.1 | | Node-ACS | 1.0.14 | | OS | OS X 10.9.2 | | Device | iPhone 5S (iOS 7.1.1) |
  2. Sabil Rahim 2014-05-28

    TIMOB-4488 exposed "sslerror" only on the android platform side. Read doc : https://github.com/appcelerator/titanium_mobile/pull/5224/files#diff-2 This is not a bug. Marking as Invalid.
  3. Lee Morris 2017-03-20

    Closing ticket as invalid.

JSON Source