简体   繁体   English

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

[英]NTLM Authentication with JMeter is receiving a SocketException

I'm trying to load test a SSO request with JMeter (version 2.13). 我正在尝试使用JMeter(版本2.13)进行负载测试SSO请求。 I followed this tutorial and set up an HTTP Authorization Manager with Username, Password, Domain and Mechanism = BASIC_DIGEST. 我按照教程进行操作,并设置了一个HTTP授权管理器,其用户名,密码,域和机制= BASIC_DIGEST。

When I set the proxy server settings of my HTTP Request to Server Name or IP = 127.0.0.1 and Port Number = 8888, I can see my request go through fiddler where it gets two 401 responses and then succeeds. 当我将HTTP请求的代理服务器设置设置为Server Name或IP = 127.0.0.1和Port Number = 8888时,我可以看到我的请求通过了fiddler,并在其中得到两个401响应,然后成功。 This shows up in the JMeter View Results Tree as a single successful request. 这将作为单个成功请求显示在JMeter视图结果树中。 However, when I remove the proxy server settings, the request fails and I get the following response: 但是,当我删除代理服务器设置时,请求失败,并且得到以下响应:

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)

The log viewer also says this: 日志查看器也这样说:

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

I have been trying all sorts of things to get this working without the proxy settings including using the HttpClient4 implementation, setting the following in user.properties 我一直在尝试各种方法来在没有代理设置的情况下实现此目的,包括使用HttpClient4实现,在user.properties中设置以下内容

hc.parameters.file=hc.parameters

and the following in httpclient.parameters 以及httpclient.parameters中的以下内容

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

I will also note that when I run the test through Fiddler, I get a prompt asking if I want to ignore remote certificate errors 我还将注意到,当我通过Fiddler运行测试时,会提示我是否要忽略远程证书错误

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

I am assuming this won't make any difference in JMeter as I read that JMeter HTTP samplers are configured to accept all certificates. 我假定这不会使JMeter的任何区别,因为我的是JMeter的HTTP取样器配置为接受所有证书。

Any help getting this up and running (without Fiddler) would be much appreciated. 任何帮助启动和运行(没有Fiddler)的帮助将不胜感激。

The problem was that the Secure Credential Store I was trying to connect to required TLS version 1.0. 问题是我试图连接到必需的TLS版本1.0的安全凭据存储。 I had to tell JMeter to use this by updating the jmeter.properties file with: 我不得不告诉JMeter通过更新jmeter.properties文件来使用它:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM