JMeter记录-响应主体返回“certificate_unknown”

iqxoj9l9  于 2023-10-20  发布在  其他
关注(0)|答案(1)|浏览(209)

我正在使用BlueStack的录音控制器和代理。我也试过自己的手机。我在JMeter中的响应体中看到了这些错误。
我已经下载了JMeter CA证书到BlueStack和我的手机。所以我想知道这些消息是否意味着我的JMeter证书出错了?或者我与外部网站的连接出错了?
我该怎么解决这个问题?
非常感谢!

avax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
    at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
    at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)
    at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:336)
    at java.base/sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:293)
    at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:185)
    at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:172)
    at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1426)
    at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1336)
    at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:450)
    at java.base/sun.security.ssl.SSLSocketImpl.ensureNegotiated(SSLSocketImpl.java:841)
    at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:932)
    at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
    at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:271)
    at org.apache.jmeter.protocol.http.proxy.HttpRequestHdr.parse(HttpRequestHdr.java:157)
    at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:214)
e5nqia27

e5nqia271#

你需要修改你的申请network security configuration
1.将下面的行添加到应用程序manifestapplication部分

android:networkSecurityConfig="@xml/network_security_config"

1.在你的app resources文件夹中创建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>

1.在调试模式下编译应用
1.将新编译的应用程序安装到模拟器或设备上
1.你现在应该可以录音了
有关详细信息,请参阅Configure Android Devices for Proxy Recording指南

相关问题