首页 文章

使用JMeter的NTLM身份验证正在接收SocketException

提问于
浏览
0

我正在尝试使用JMeter(版本2.13)加载测试SSO请求 . 我按照this教程设置了一个HTTP授权管理器,其中包含用户名,密码,域和机制= BASIC_DIGEST .

当我将我的HTTP请求的代理服务器设置设置为服务器名称或IP = 127.0.0.1和端口号= 8888时,我可以看到我的请求通过fiddler获得两个401响应,然后成功 . 这显示在JMeter视图结果树中作为单个成功请求 . 但是,当我删除代理服务器设置时,请求失败,我得到以下响应:

java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at sun.security.ssl.InputRecord.readFully(Unknown Source)
    at sun.security.ssl.InputRecord.read(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:436)
    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
    at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
    at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.open(MeasuringConnectionManager.java:107)
    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:643)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:517)
    at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:331)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1135)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
    at java.lang.Thread.run(Unknown Source)

日志查看器也说:

org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$6: I/O exception (java.net.SocketException) caught when connecting to the target host: Connection reset

我一直在尝试各种各样的事情来使这个工作没有代理设置,包括使用HttpClient4实现,在user.properties中设置以下内容

hc.parameters.file=hc.parameters

以及httpclient.parameters中的以下内容

http.protocol.reject-relative-redirect$Boolean=true

我还要注意,当我通过Fiddler运行测试时,我得到一个提示,询问是否要忽略远程证书错误

Session #106: The remote server (server name here) presented a certificate that did not validate, due to RemoteCertificateChainErrors.
0 - Unknown error.

我假设这不会对JMeter产生任何影响,因为JMeter HTTP采样器被配置为接受所有证书 .

任何有助于实现这一目标(没有Fiddler)的帮助将非常感激 .

1 回答

  • 0

    问题是Secure Credential Store我试图连接到所需的TLS版本1.0 . 我不得不通过更新jmeter.properties文件告诉JMeter使用它:

    https.default.protocol=TLS
    https.socket.protocols=TLSv1
    

相关问题