HTTPS in PAC file

瘦欲@ 提交于 2019-12-23 11:53:17

问题


I am writing a .pac file for use with iOS5 without jailbreak, but I feel trouble in matching the url starting with "https" (eg: https://test.com).

Here is my script:

function FindProxyForURL(url, host) {
  if (shExpMatch(url, "https://*")) return "PROXY 123.123.123.123";
  return 'DIRECT';
}

And if I matched "https://test.com", how can I return "https://123.123.123.123" to the URL?


回答1:


This should not have been accepted. Please vote to delete if you can.


Original answer:

You cannot proxy the HTTPS protocol without breaking end-to-end security, which is its single distinguishing feature. The reason your matches "don't work" is that your PAC file is ignored for HTTPS.

Routing the traffic between the browser and an on-device proxy over HTTPS is also quite pointless, regardless of whether it is technically possible. I imagine it has been made impossible for security reasons (so that users cannot be fooled to think traffic is secure when it isn't) but I have not investigated.




回答2:


Use this:

if (shExpMatch(url, "https:**"))

This should fix it.



来源:https://stackoverflow.com/questions/9493978/https-in-pac-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!