我在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文档。