Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Untrusted server certificate error with webview.

Hi, I'm building an internal iPad app for a company intranet that needs to show webpages over https from a server that has a self-signed certificate.

I'm using a standard webview (Ti.UI.createWebView()) and get the following error:

[ERROR] Error loading: app://com.pinnacol.dwq/(null), Error: Error Domain=NSURLErrorDomain Code=-1202 UserInfo=0xd2044f0 "untrusted server certificate"

I know that view Objective-C there is a way to accept self-signed certificates. Is there a property or other mean that can be used on the Titanium.UI.WebView?

— asked April 16th 2010 by Daniel Wanja
  • certificate
  • https
  • self-signed
  • webview
0 Comments

4 Answers

  • Heres a solution, modify the SDK files.

    http://developer.appcelerator.com/question/120117/webview-ssl-certificate-error—no-way-to-accept-expired-server-certificate—ipad-app.html#answer-213681

    — answered July 19th 2011 by Chris Moore
    permalink
    0 Comments
  • Yea i'm looking for an answer similar to this question too

    — answered April 20th 2010 by Jimmy Lesondak
    permalink
    0 Comments
  • I know this is a hack, but the way I just solved this problem was to open the files using the HTTPClient and save them to a temp directory, when completed… I render the file in a WebView.

    Still looking to see if I can load the response data directly into the webview for better performance

    also include this

    http://developer.appcelerator.com/question/50741/https-based-webservices

    — answered November 10th 2010 by Aaron Saunders
    permalink
    0 Comments
  • You should be able to simply set the validatesSecureCertificate property to false. That connection should then ignore any certificate errors.

    — answered November 10th 2010 by Mike Robinson
    permalink
    2 Comments
    • Does anyone know how to set this property for a WebView?

      — commented July 11th 2011 by John Doxey
    • +1 for John Doxey question..

      — commented May 13th 2013 by Ludwig Leuschner
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.