mike10004 / selenium-traffic-example

Example of capturing network traffic with Selenium and Browsermob-proxy
MIT License
1 stars 1 forks source link

Empty Har file #1

Open Mohxin opened 8 years ago

Mohxin commented 8 years ago

Hi, when i use to code to bypass the cooporate proxy and access the local intranet i got some proxy (for example could not authorize), but it works fine to access the internet e.g cnn.com , yahoo.com.

DO you know how to solve the certificate problem while accessing the local intranet?

mike10004 commented 8 years ago

i got some proxy (for example could not authorize)

Could you explain this? What did you see? Can you show a screenshot or copy the text here?

DO you know how to solve the certificate problem while accessing the local intranet?

What makes you think there is a certificate problem?

Mohxin commented 8 years ago

Please find the attached files.

I have attached the screenshot of Exception , Har file and CreateProxy method configuration exception createproxy config

Mohxin commented 8 years ago

{"log":{"version":"1.2","creator":{"name":"BrowserMob Proxy","version":"2.1.2","comment":""},"pages":[{"id":"myExample","startedDateTime":"2016-11-18T11:10:42.171+01:00","title":"myExample","pageTimings":{"comment":""},"comment":""}],"entries":[],"comment":""}}

mike10004 commented 8 years ago

Where you edited the createProxy() method, I think you still need to use a MITM manager if you are capturing HTTPS traffic, and also you have to set the upstream proxy if you need to go through a corporate proxy.

That is, retain the bmp.setMitmManager(createMitmManager(bmp)) call, and after you create your custom upstreamProxyAddress instance, make sure to set it:

bmp.setChainedProxy(upstreamProxyAddress);
bmp.chainedProxyAuthorization("user", "password", AuthType.BASIC);