Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jmeter - Java.Net.SocketException

I am running a Jmeter script on a web-application which is hosted on IIS and using ADFS authentication mechanism. For each request in Jmeter,it fails due to "Java.Net.SocketException ".

What I have done is: Used HTTP Authentication manager to provide credentials for each user from CSV data config element.But seems like still Jmeter is not logging-in.

Followed the documentation of Jmeter HTTP authorization manager but it looks like it's not login to the application

In the Jmeter log files -I see is :

org.apache.commons.httpclient.auth.AuthChallengeProcessor: ntlm authentication scheme selected 
2014/05/22 16:34:22 INFO  - org.apache.commons.httpclient.HttpMethodDirector: No credentials available for NTLM <any realm>@DomainName:PortNumber ..
2014/05/22 16:34:31 INFO  - jmeter.protocol.http.sampler.HTTPHC4Impl: HTTP request retry count = 1 
2014/05/22 16:34:31 INFO  - jmeter.protocol.http.sampler.HTTPHC4Impl: Setting up HTTPS TrustAll scheme 
2014/05/22 16:34:32 INFO  - org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$4: I/O exception (java.net.SocketException) caught when processing request: Connection reset 
2014/05/22 16:34:32 INFO  - org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$4: Retrying request 
2014/05/22 16:34:32 INFO  - org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$4: I/O exception (java.net.SocketException) caught when processing request: Connection reset 
2014/05/22 16:34:32 INFO  - org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$4: Retrying request 
_________________
java.net.SocketException: Connection reset
    at sun.reflect.GeneratedConstructorAccessor64.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection$10.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at java.net.HttpURLConnection.getResponseCode(Unknown Source)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
    at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.readResponse(HTTPJavaImpl.java:264)
    at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:520)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1088)
    at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1077)
    at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:428)
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:256)
    at java.lang.Thread.run(Unknown Source)
Caused by: 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.readDataRecord(Unknown Source)
    at sun.security.ssl.AppInputStream.read(Unknown Source)
    at java.io.BufferedInputStream.fill(Unknown Source)
    at java.io.BufferedInputStream.read1(Unknown Source)
    at java.io.BufferedInputStream.read(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
    at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)

Can above exception occur due to authentication failure ?

Please suggest to resolve this issue.

Thanks in advance!!

like image 662
user2766171 Avatar asked Oct 31 '22 23:10

user2766171


1 Answers

You may have improper configuration of your HTTP Authorization Manager

As per AD FS 2.0: How to Change the Local Authentication Type ADFS can be configured to support following authentication types:

  1. Integrated Windows authentication (IWA) - NTLM or Kerberos
  2. Forms-based authentication (FBA)
  3. Transport layer security client authentication
  4. Basic authentication

Points 1 and 4 can be handled via HTTP Authorization Manager. See Windows Authentication with Apache JMeter guide for how-to.

Point 2 can be handled via correlation (i.e. Regular Expression Extractor)

Point 3 I believe it can be handled via Keystore Configuration

like image 61
Dmitri T Avatar answered Nov 08 '22 08:11

Dmitri T