问题
Android TAB and JMeter is being used to capture/ Record the application flow. But the HTTPS reqests are not capturing in JMeter. I turned off Jmeter and enabled Charles Proxy and did the recording again. After recording the same application flow in Charles I took all the HTTPS requests and placing in Jmeter. It took longer time because am doing the recording twice.
Is there any other way to capture the HTTPS traffic via JMETER?
Apprecaite your help and share your suggestions.
Regards, Siva
回答1:
Certain Android versions support only HTTP proxying out of the box, you may have to install 3rd-party software like ProxyDroid in order to be able to configure HTTPS Proxy.
Easier option is using Mobile Recorder solution, if you have doubts regarding correctness of your JMeter side of things configuration you can test Mobile Recorder.
回答2:
First use JMeter Recording Template
Then start JMeter's HTTP(S) Test Script Recorder, it will generate in jmeter/bin folder, a file called ApacheJMeterTemporaryRootCA.crt .
Copy file to your android device and install it as CA Certificate.
See How do I install a user certificate? thread for more details.
The certificate has limited life time (defaults to 7 days) but you can extend it by setting in user.properties
proxy.cert.validity=Number of days
Now the problem you'll face in Android >= 7.0 is that applications only use by default System installed Certificates.
So you'll need to ask developper of application to modify the APK, see why here.
Edit manifest and add :
android:networkSecurityConfig="@xml/network_security_config"
You'll get:
...
Then add in res/xml/network_security_config.xml this:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config>
<trust-anchors>
<!-- Trust preinstalled CAs -->
<certificates src="system" />
<!-- Additionally trust user added CAs -->
<certificates src="user" />
</trust-anchors>
</base-config>
</network-security-config>
Note that this is needed whatever tool you use (Neoload, LoadRunner, ...)
来源:https://stackoverflow.com/questions/31489661/not-able-to-capture-https-request-mobile-performance-testing