【问题标题】:Got Certificate issue even after installed the Jmeter security certificate即使在安装了 Jmeter 安全证书后也有证书问题
【发布时间】:2019-11-13 12:35:34
【问题描述】:

我需要使用 JMeter 对 Android 应用进行负载测试

  • 在移动设备上,配置手动代理设置并安装 JMeter 根证书
  • 系统和手机仅在同一 WiFi 上
  • 在 JMeter 上,开始记录得到报告,用于移动打开、登录和一些页面
  • 在报告时,显示 SSL 证书错误

请帮忙解决这个问题

【问题讨论】:

    标签: performance jmeter blazemeter


    【解决方案1】:

    如果您尝试使用 Android >= 7.0 (Nougat) 记录您的移动设备网络流量,您需要执行一些额外的步骤来配置您的应用程序以使用 JMeter 的证书:

    1. 在您的应用程序manifest file 中将以下行添加到<application> tag

      android:networkSecurityConfig="@xml/network_security_config"
      
    2. 在您的应用程序的res folder 下创建文件network_security_config.xml 并输入以下代码:

      <?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. 在debug mode 中构建您的应用程序

      gradlew assembleDebug
      
    4. 用新构建的调试版本替换设备上的应用程序 - 您可以使用 JMeter 记录此版本。

    如果您无权访问您的应用程序源,则必须将您的设备 root,convert JMeter's certificate into PEM format using OpenSSL and copy it to Android OS trusted certificates area using ADB。

    更多信息:Recording Using Android Devices

    【讨论】:

    • 感谢您的回复.. 我也可以为 Ionic 应用程序执行这些步骤吗..?
    • 框架无关紧要,它是 Android OS 增强的网络安全性。如果您的应用程序可以在 Android
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-02-06
    • 2023-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-06-25
    相关资源
    最近更新 更多