Windows 10不读取文件协议引用的 PAC 文件
重要
Internet Explorer 11 桌面应用程序将于 2022 年 6 月 15 日停用并停止支持 (有关范围列表,请参阅常见问题解答)。 现在正在使用的 IE11 应用和网站可以在 Microsoft Edge 的 Internet Explorer 模式下打开。 在此处了解详细信息。
本文解决了一个问题Internet Explorer或Microsoft Edge无法读取文件协议 (PAC) 文件代理自动配置。
原始产品版本: Windows 10、Microsoft Edge、Internet Explorer 11
原始 KB 编号: 4025058
症状
请考虑以下情况:
你已配置 Microsoft Internet Explorer 11 或 Microsoft Edge Windows 10"使用 自动配置脚本" 选项。
你正在测试或部署 PAC 文件。 你将文件存储在本地位置,例如 C:\temp\proxy.pac。
You specified the file location in the Use Automatic Configuration script option in Internet Setting by using the file protocol.
您创建了以下注册表子项:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ Value: EnableLegacyAutoProxyFeature Type:REG_DWORD Data:1
在此方案中,PAC 文件不由用户或Internet Explorer Microsoft Edge。
原因
出现此问题的原因是Internet Explorer Microsoft Edge Windows 10的计算机使用 WinHttp 代理服务检索代理服务器信息。 WinHttp 代理服务不支持对 PAC 文件使用 ftp://
或 file://
协议。
解决方案
若要解决此问题,在 Web 服务器上托管 PAC 文件,然后使用 http 协议引用它。
备注
必须指定 Web 服务器上 PAC 文件的应用程序 /x-ns-proxy-autoconfig MIME 类型,WinHttp 代理服务才能使用 PAC 文件。
如果不是,PAC 文件的扩展名必须为 .dat 、.js 、.pac 或 .jvs。