使用 JMeter 的 NTLM 身份验证正在接收 SocketException
NTLM Authentication with JMeter is receiving a SocketException
我正在尝试使用 JMeter(版本 2.13)对 SSO 请求进行负载测试。我按照 this 教程设置了一个 HTTP 授权管理器,用户名、密码、域和机制 = BASIC_DIGEST。
当我将我的 HTTP 请求的代理服务器设置设置为服务器名称或 IP = 127.0.0.1 和端口号 = 8888 时,我可以看到我的请求通过 fiddler 获得两个 401 响应然后成功。这在 JMeter View Results Tree 中显示为单个成功请求。但是,当我删除代理服务器设置时,请求失败并收到以下响应:
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: 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 产生任何影响,因为我 read JMeter HTTP 采样器配置为接受所有证书。
如果能提供任何帮助,运行ning(没有 Fiddler),我们将不胜感激。
问题是我尝试连接到所需的 TLS 版本 1.0 的安全凭据存储。我不得不告诉 JMeter 通过更新 jmeter.properties 文件来使用它:
https.default.protocol=TLS
https.socket.protocols=TLSv1
我正在尝试使用 JMeter(版本 2.13)对 SSO 请求进行负载测试。我按照 this 教程设置了一个 HTTP 授权管理器,用户名、密码、域和机制 = BASIC_DIGEST。
当我将我的 HTTP 请求的代理服务器设置设置为服务器名称或 IP = 127.0.0.1 和端口号 = 8888 时,我可以看到我的请求通过 fiddler 获得两个 401 响应然后成功。这在 JMeter View Results Tree 中显示为单个成功请求。但是,当我删除代理服务器设置时,请求失败并收到以下响应:
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: 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 产生任何影响,因为我 read JMeter HTTP 采样器配置为接受所有证书。
如果能提供任何帮助,运行ning(没有 Fiddler),我们将不胜感激。
问题是我尝试连接到所需的 TLS 版本 1.0 的安全凭据存储。我不得不告诉 JMeter 通过更新 jmeter.properties 文件来使用它:
https.default.protocol=TLS
https.socket.protocols=TLSv1