0
votes

I need to do load testing for Android app using JMeter

  • On Mobile Device, Configured Manual Proxy settings and Installed JMeter root certificate
  • System and Mobile on Same WiFi only
  • On JMeter, Started Recording Got Report for Mobile open, login and some pages
  • On Report, an SSL certificate error is displayed enter image description here

Please help to solve this issue

1

1 Answers

1
votes

If you're trying to record your mobile device network traffic using Android >= 7.0 (Nougat) you need to perform some extra steps in order to configure your application to use JMeter's certificate:

  1. In your application manifest file add the following line to the <application> tag

    android:networkSecurityConfig="@xml/network_security_config"
    
  2. Under res folder of your application create file network_security_config.xml and put the following code:

    <?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>
    
  3. Build your application in debug mode

    gradlew assembleDebug
    
  4. Replace the application on the device with the newly build debug version - this one you can record with JMeter.

If you don't have access to your application sources you will have to root your device, convert JMeter's certificate into PEM format using OpenSSL and copy it to Android OS trusted certificates area using ADB.

More information: Recording Using Android Devices