title: Using a PAC file in a Chrome Extension to redirect HTTPS requests seems to fail
body: <p>I'm setting up a <strong>Chrome Extension (version 40)</strong> for myself and my work colleagues. </p>
  
  <p>One of it's functions is to automatically redirect requests that are received within the browser to our staging server IP address. This allows us to avoid editing host files to switch between staging and production as is currently done. Every minute counts..</p>
  
  <p>Anyway the following script that I set up works perfectly when using the proxy config for HTTP requests. But when trying to run it on sites that request the url using https it fails with the following error. </p>
  
  <blockquote>
    <p>net::ERR_TUNNEL_CONNECTION_FAILED</p>
  </blockquote>
  
  <p>Here's the main gist of the code that I've set up so far. </p>
  
  <p><a href="http://findproxyforurl.com/example-pac-file/" rel="nofollow noreferrer">PAC File</a>: <code>https://awesomeurl.com/proxy.pac</code></p>
  
  <pre><code>function FindProxyForURL(url, host) {
    var domains = ["url1", "url2", "url3", "url4"], // fake company urls
        base = ".awesomecompany.com",
        ii;
  
    // our local URLs from the domains below example.com don"t need a proxy:
  
    for(ii=0; ii&lt;domains.length; ii++) {
      if(shExpMatch(host, domains[ii] + base)) {
        return "PROXY 11.111.111.111"; // Fake IP Address
      }
    }
    return "DIRECT";
  }
  </code></pre>
  
  <p>And here's the script that generates the Chrome settings. Persistence is done elsewhere. </p>
  
  <pre><code>/**
   * Checks which value has been selected and generates the proxy config that will
   * be used for the the chrome settings and persisted.
   *
   * @param {string} mode The mode requested by the user
   * @return {ProxyConfig} the proxy configuration reprensented by the user's selections
   * @public
   *
   */
  function generateProxyConfig(mode) {
    switch(mode) {
      case proxyValues.NORMAL:
        return { mode: 'system' }
  
      case 'production':
        return {
          mode: 'pac_script',
          pacScript: {
            url: 'https://awesomeurl.com/proxy.pac',
            mandatory: true
          }
        }
    }
  }
  
  function applyChanges ( mode, cb ) {
    config = generateProxyConfig( mode );
  
    chrome.proxy.settings.set({
      value: config,
      scope: 'regular'
    }, cb );
  }
  
  applyChanges('production', function() {console.log('Why doesn't this work for https') })
  </code></pre>
  
  <p>The only resource I found that was even remotely relevant <a href="https://stackoverflow.com/questions/9493978/https-in-pac-file">was this one</a>. It seems to imply that for iOS the PAC file can't be used to redirect HTTPS traffic due to security implications. </p>
  
  <p>I guess I want to see if this is the same with Chrome. Please provide any known potential workarounds.</p>