Reputation: 11
Can we create script of a native mobile application (Android here, not a Hybrid application or Mobile Browser based application).
I did all sorts of configurations required in Mobile- like setting proxy matching to the IP4 of the machine JMeter is run on. When i start recording I see listener of HTTP(S) Test Script Recorder showing errors: Response message:Received fatal alert: certificate_unknown ensure browser is set to accept the JMeter proxy certificate and Response as: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
Kindly hep to get an understanding of the concept and how to fix it. Thanks, PS
Upvotes: 0
Views: 431
Reputation: 168147
First of all make sure to import the JMeter's MITM certificate to your Android device. The certificate file is called ApacheJMeterTemporaryRootCA.crt
and it's being generated in "bin" folder of your JMeter installation when you start the HTTP(S) Test Script Recorder.
See HTTPS recording and certificates chapter of the HTTP(S) Test Script Recorder documentation for more information
If you're running Android 7.0 or higher you will need to take some extra steps in order to be able to capture native application traffic, in particular:
Add the next line to the application
section of your Android app manifest file:
android:networkSecurityConfig="@xml/network_security_config"
Create network_security_config.xml
file under your app resources folder and put the following code inside:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<debug-overrides>
<trust-anchors>
<!-- Trust user added CAs while debuggable only -->
<certificates src="user" />
</trust-anchors>
</debug-overrides>
</network-security-config>
Compile and install your application in debug mode like:
gradlew installDebug
Once you follow the above steps and launch the debug version of the application with lowered network security you should be able to intercept and decrypt its traffic using JMeter's proxy server.
More information: Recording Using Android Devices
Upvotes: 1