Skip to content

My practice for making a dangerous webview

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

simnalamburt/ios-dangerous-webview-practice

Repository files navigation

iOS dangerous webview practice

You can force UIWebView to show web pages with invalid certificates. This sample app precisely allows a few predefined domains, rather than blindly allowing all insecure HTTPS loads.

You don't need to go through the whole source codes. Just take a look at the two source files.

Using UIWebViewDelegate, it intercepts the HTTPS requests before it fails. The answers in stack overflow solve this problem with a few codes but it doesn't cover all corner cases. To do this in production, The logic gets quite complicated. You'll have read the whole codes of ViewController.m.

It makes a few exceptions to the iOS's App Transport Security. You'll have to configure it, server-by-server.

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSExceptionDomains</key>
  <dict>
    <key>m.domain.go.kr</key>
    <dict>
      <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key><true/>
      <key>NSTemporaryExceptionRequiresForwardSecrecy</key><false/>
    </dict>
    <key>www.domain.go.kr</key>
    <dict>
      <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key><true/>
      <key>NSTemporaryExceptionRequiresForwardSecrecy</key><false/>
    </dict>
  </dict>
</dict>
References


ios-dangerous-webview-practice is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0). See COPYRIGHT for details.

About

My practice for making a dangerous webview

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published