saucelabs - 无法启动与代理的酱汁连接 - 下一个 InitializeSecurityContext 失败:SEC_E_UNTRUSTED_ROOT
问题描述
我在 Windows 中使用最新的酱汁连接,并且在没有代理的情况下工作正常。现在,如果我使用 browsermobproxy,并尝试启动酱连接,它会失败并出现错误
>sc -u userName -k token -i tunnelName --proxy 127.0.0.1::9091 --doctor
!!! ERROR: connecting via 127.0.0.1::9091 to http://saucelabs.com:443: Couldn't connect to server.
INFO: checking if accessing https://saucelabs.com/rest/v1 works
INFO: using proxy 127.0.0.1::9091 for https://saucelabs.com/versions.json (saucelabs.com)
!!! ERROR: connecting to https://saucelabs.com/versions.json: Couldn't connect to server, reply: [empty].
!!! WARNING: can't reach https://saucelabs.com/versions.json, please check your firewall and proxy settings.
为了curl -v --proxy http://localhost:9091 https://ondemand.saucelabs.com/wd/hub/status
得到
* schannel: encrypted data buffer: offset 2241 length 4096
* schannel: next InitializeSecurityContext failed: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted.
* Closing connection 0
我需要做些什么改变?
解决方案
这是由于 Browsermob 代理按预期工作引起的,它破坏了 HTTPS 安全链以检查通过它的流量。
要将 BMP(或 WonderProxy 或其他任何东西)与 Sauce Connect 一起使用,您需要配置 Sauce Connect 以在不通过 BMP 的情况下建立安全连接,然后将其用于被测流量。
最好的方法是创建一个 PAC 文件:
function FindProxyForURL(url, host) {
if (shExpMatch(host, "*.miso.saucelabs.com") ||
shExpMatch(host, "*.saucelabs.com") ||
shExpMatch(host, "saucelabs.com")) {
// KGP and REST connections. Another proxy can also be specified.
return "DIRECT";
}
// Test HTTP traffic, route it through the BMP proxy.
return "PROXY localhost:9091";
}
--pac
然后使用以下选项将其传递给 Sauce Connect :
--pac file://path/to/your/pacfile.pac
有关使用多个代理的更多信息,请参阅Sauce Connect 文档。
推荐阅读
- c++ - 基于模板元组数量的C++ Enable方法
- flutter - Flutter - 深色主题上的 BoxShadow 无法正确渲染
- powershell - 通过 PowerShell 提取 Office 365 组需要 ManagedBy 属性来显示 UPN 而不是显示名称
- xamarin - DevExpress - Web 仪表板在 iPad 中不可见,Xamarin.IOS 使用 WKWebView 渲染器加载它
- unity3d - Unity 镜像网络对象不在客户端上移动
- javascript - 如何通过在输入中输入视频 ID 来嵌入 youtube 视频?
- r - 为什么我没有在 R 中根据 id 和另一列获得正确的计数?
- java - 使用 AtomicReference 从另一个线程访问 Object
- android - 输入后在firefox mobile上以全屏模式显示丑陋的导航栏
- javascript - ReactJS 获取触发页面重新加载