browsermob-proxy
browsermob-proxy copied to clipboard
Browsermob MITM not working with android emulator
I'm using the browsermob standalone proxy 2.1.4 in order to intercept traffic from the android emulator. I'm running the android virtual device from the terminal passing in -http-proxy [proxy url:port]
to specify the proxy running on my device. I have the ca-certificate-rsa.cer
installed on my android virtual device.
When the device tries to make any https requests browsermob gives a General SSLEngine problem. Requests seem to never come back on the device.
This was recently working, however I upgraded the version of the android emulator I was using to 26.1.3
and that's when I noticed this issue.
Below is the error browsermob gives.
[ERROR 2017-08-28T16:14:44,454 org.littleshoot.proxy.impl.ProxyToServerConnection] (LittleProxy-0-ProxyToServerWorker-4) (DISCONNECTED) [id: 0x064f952b, L:0.0.0.0/0.0.0.0:52887 ! R:/172.217.11.74:443]: Caught an exception on ProxyToServerConnection io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: General SSLEngine problem
at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:442) ~[browsermob-dist-2.1.4.jar:?]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:248) ~[browsermob-dist-2.1.4.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:373) [browsermob-dist-2.1.4.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359) [browsermob-dist-2.1.4.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:351) [browsermob-dist-2.1.4.jar:?]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334) [browsermob-dist-2.1.4.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:373) [browsermob-dist-2.1.4.jar:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:359) [browsermob-dist-2.1.4.jar:?]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926) [browsermob-dist-2.1.4.jar:?]
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:129) [browsermob-dist-2.1.4.jar:?]
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:651) [browsermob-dist-2.1.4.jar:?]
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:574) [browsermob-dist-2.1.4.jar:?]
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:488) [browsermob-dist-2.1.4.jar:?]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:450) [browsermob-dist-2.1.4.jar:?]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:873) [browsermob-dist-2.1.4.jar:?]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_92]
If I start the proxy using trustAllServers=true
then I get the following error.
[WARN 2017-08-28T17:05:57,457 io.netty.util.concurrent.DefaultPromise] (LittleProxy-0-ClientToProxyWorker-6) An exception was thrown by org.littleshoot.proxy.impl.ConnectionFlow$2.operationComplete() net.lightbody.bmp.mitm.exception.MitmException: Error creating SSLEngine for connection to client to impersonate upstream host: null
at net.lightbody.bmp.mitm.manager.ImpersonatingMitmManager.clientSslEngineFor(ImpersonatingMitmManager.java:227) ~[browsermob-dist-2.1.4.jar:?]
at org.littleshoot.proxy.impl.ProxyToServerConnection$3.execute(ProxyToServerConnection.java:724) ~[browsermob-dist-2.1.4.jar:?]
at org.littleshoot.proxy.impl.ConnectionFlow.doProcessCurrentStep(ConnectionFlow.java:140) ~[browsermob-dist-2.1.4.jar:?]
at org.littleshoot.proxy.impl.ConnectionFlow.processCurrentStep(ConnectionFlow.java:128) ~[browsermob-dist-2.1.4.jar:?]
For me too browser mob proxy not working in emulator. Any solutions for this?
Has anybody got a solution / root cause of this problem? I am getting a same error while trying to intercept network traffic of an android device using BMP and Drony. The issue is reproduced both on emulator and real device.
Any solution using -http-proxy
?
I was able to capture traffic only when I set the proxy manually in the wifi network of the emulator but this is not the way to do automation
Any solution on this?
Hey guys I'm facing the same problem any suggestions? @jekh