如何使用 BrowserMob 代理拦截 SSL 请求 [英] How can I intercept SSL requests with BrowserMob proxy

查看:103
本文介绍了如何使用 BrowserMob 代理拦截 SSL 请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Selenium 的测试自动化项目中使用 BrowserMob 代理 2.0-beta-8.我正在测试的页面使用 https,我需要重写用户代理标头.对于普通的 http 请求,一切正常 - 请求拦截器被调用,我可以重写标头.但是,对于 https 请求,根本不会调用拦截器.

I am using BrowserMob proxy 2.0-beta-8 in a test automation project with Selenium. The page I'm testing against is using https and I need to rewrite the user agent header. For plain http requests everything works fine - the request interceptor is called and I can rewrite the header. However, for https requests the interceptor is not called at all.

BrowserMob 目前不支持拦截 https 请求还是我在这里遗漏了什么?

Does BrowserMob currently not support intercepting https requests or am I missing something here?

推荐答案

您没有提到您使用的是什么浏览器:

You did not mention what browser are you using:

1) 如果您使用的是 Firefox/Chrome、Selenium2 和 BrowserMob >=2.0-beta8,那么一切都应该是开箱即用的

1) If you are using Firefox/Chrome, Selenium2 and BrowserMob >=2.0-beta8 then everything should work out of the box

2) 如果您使用的是其他浏览器,检查如何安装浏览器 CA 证书

2) If you are using other browser, check how to install browser CA certificate

这篇关于如何使用 BrowserMob 代理拦截 SSL 请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆