[ grinder-Bugs-3484390 ] FireFox 10/https:NPE in ConnectionHandlerImplementation
SourceForge.net <[email protected]> Tue, 18 Sep 2012 14:55:57 -0700
| Newsgroups | gmane.comp.java.grinder.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #3484390, was opened at 2012-02-04 08:58
Message generated for change (Settings changed) made by philipa
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3484390&group_id=18598
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: TCPProxy
Group: None
>Status: Closed
Resolution: None
Priority: 5
Private: No
Submitted By: Philip Aston (philipa)
Assigned to: Philip Aston (philipa)
Summary: FireFox 10/https:NPE in ConnectionHandlerImplementation
Initial Comment:
Two users (Ouray Viney and Zack) independently report the following stack when recording over HTTPS:
1/17/12 9:08:43 AM (tcpproxy): Failed to determine proxy destination.
Client opened connection but sent no bytes.
1/17/12 9:08:43 AM (tcpproxy): UNEXPECTED - No current request
Exception in thread "Filter thread for site.test.com:443->127.0.0.1:2391" java.lang.NullPointerException
at net.grinder.plugin.http.tcpproxyfilter.ConnectionHandlerImplementation$Request.expectingResponseBody(ConnectionHandlerImplementation.java:400)
at net.grinder.plugin.http.tcpproxyfilter.ConnectionHandlerImplementation.handleResponse(ConnectionHandlerImplementation.java:277)
at net.grinder.plugin.http.tcpproxyfilter.ConnectionCache.response(ConnectionCache.java:111)
at net.grinder.plugin.http.tcpproxyfilter.HTTPResponseFilter.handle(HTTPResponseFilter.java:71)
at net.grinder.tools.tcpproxy.CompositeFilter.handle(CompositeFilter.java:58)
at net.grinder.tools.tcpproxy.AbstractTCPProxyEngine$OutputStreamFilterTee.handle(AbstractTCPProxyEngine.java:548)
at net.grinder.tools.tcpproxy.AbstractTCPProxyEngine$FilteredStreamThread.interruptibleRun(AbstractTCPProxyEngine.java:417)
at net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:59)
at java.lang.Thread.run(Unknown Source)
I initially though this could be a connection time out. Zack says "Setting the connection timeout to higher values did not help. Actually the exception occurs immediately after requesting the HTTPS url in the browser, so I'm not sure the timeout setting is involved."
----------------------------------------------------------------------
Comment By: Philip Aston (philipa)
Date: 2012-03-16 12:05
Message:
That sounds like bug 3505060.
----------------------------------------------------------------------
Comment By: Hugo Valk (hugovalk)
Date: 2012-03-16 05:51
Message:
I have tested the replacement jar. Loading of certain resources is terribly
slow. Furthermore, I am still seeing stacktraces in the console:
2012-03-16 13:47:01,503 ERROR tcpproxy: Expected content length exceeded,
truncating
2012-03-16 13:47:01,816 ERROR tcpproxy: Received fatal alert:
unexpected_message
javax.net.ssl.SSLException: Received fatal alert: unexpected_message
at
com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:190)
~[na:1.6]
at
com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Alerts.java:136)
~[na:1.6]
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1806)
~[na:1.6]
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:986)
~[na:1.6]
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1170)
~[na:1.6]
at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:785)
~[na:1.6]
at
com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
~[na:1.6]
at
net.grinder.tools.tcpproxy.AbstractTCPProxyEngine$FilteredStreamThread.interruptibleRun(AbstractTCPProxyEngine.java:431)
~[grinder-http-3.7.1.jar:na]
at
net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:58)
[grinder-core-3.7.1.jar:na]
at java.lang.Thread.run(Thread.java:662) [na:1.6.0_31]
----------------------------------------------------------------------
Comment By: Philip Aston (philipa)
Date: 2012-02-25 01:38
Message:
Please try to download the attachment again.
There's some issues with sourceforge attachments
https://sourceforge.net/p/allura/tickets/3638/ Downloads failed for me
yesterday, but are working again today.
----------------------------------------------------------------------
Comment By: Angelo (kopritis)
Date: 2012-02-23 12:05
Message:
I'm experiencing the same issue, however it seems that the attached patches
are corrupt.
----------------------------------------------------------------------
Comment By: Ajinkya Karande (akarande)
Date: 2012-02-14 15:14
Message:
Well thanks Philipa, this time it worked. I just added the path to my
current classpath as I did before, and the webpage loaded successfully.
Thank you once again for the patch.
Best,
Ajinkya Karande.
----------------------------------------------------------------------
Comment By: Philip Aston (philipa)
Date: 2012-02-14 13:20
Message:
I can tell from the stack trace that patch3484390-2.jar is not applied
properly for either of you. This is weird - yesterday I reproduced the
problem with 3.7.1, downloaded the patch from SF, and used to fix the
problem.
Anyway, lets try a different way of patching. I'll attach a
grinder-http-3.7.1.jar. Download it, check its size (183166 bytes), back up
the version currently in you lib directory, and drop it in its place.
----------------------------------------------------------------------
Comment By: Ajinkya Karande (akarande)
Date: 2012-02-14 09:35
Message:
Now the classpath looks something like this
\
CLASSPATH="/home/user/patches/patch3484390-2.jar:../engine/grinder/lib/grinder.jar"
java -cp $CLASSPATH net.grinder.TCPProxy -console -http > $1
I have tried for both the jar files that were provided above. I am still
not able to get through the websites which has https in their url.
I am not sure if I need to set any other variable..
Error:
2012-02-14 09:27:26,907 ERROR tcpproxy: UNEXPECTED - No current request
Exception in thread "Filter thread for
login-apsstg2.soma.salesforce.com:443->localhost:39218"
java.lang.NullPointerException
at
net.grinder.plugin.http.tcpproxyfilter.ConnectionHandlerImplementation$Request.expectingResponseBody(ConnectionHandlerImplementation.java:400)
at
net.grinder.plugin.http.tcpproxyfilter.ConnectionHandlerImplementation.handleResponse(ConnectionHandlerImplementation.java:277)
at
net.grinder.plugin.http.tcpproxyfilter.ConnectionCache.response(ConnectionCache.java:110)
at
net.grinder.plugin.http.tcpproxyfilter.HTTPResponseFilter.handle(HTTPResponseFilter.java:66)
at
net.grinder.tools.tcpproxy.CompositeFilter.handle(CompositeFilter.java:50)
at
net.grinder.tools.tcpproxy.AbstractTCPProxyEngine$OutputStreamFilterTee.handle(AbstractTCPProxyEngine.java:577)
at
net.grinder.tools.tcpproxy.AbstractTCPProxyEngine$FilteredStreamThread.interruptibleRun(AbstractTCPProxyEngine.java:437)
at
net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:58)
at java.lang.Thread.run(Thread.java:636)
2012-02-14 09:27:34,458 ERROR tcpproxy: UNEXPECTED - No current request
2012-02-14 09:28:34,408 ERROR tcpproxy: java.net.SocketException:
Connection reset
javax.net.ssl.SSLException: java.net.SocketException: Connection reset
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208) ~[na:1.6.0_20]
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1697)
~[na:1.6.0_20]
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1660)
~[na:1.6.0_20]
at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1624)
~[na:1.6.0_20]
at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1569)
~[na:1.6.0_20]
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
~[na:1.6.0_20]
at
net.grinder.tools.tcpproxy.AbstractTCPProxyEngine$FilteredStreamThread.interruptibleRun(AbstractTCPProxyEngine.java:431)
~[grinder-http-3.7.1.jar:na]
at
net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:58)
[grinder-core-3.7.1.jar:na]
at java.lang.Thread.run(Thread.java:636) [na:1.6.0_20]
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:185)
~[na:1.6.0_20]
at sun.security.ssl.InputRecord.readFully(InputRecord.java:312)
~[na:1.6.0_20]
at sun.security.ssl.InputRecord.read(InputRecord.java:350) ~[na:1.6.0_20]
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:850)
~[na:1.6.0_20]
at
sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1190)
~[na:1.6.0_20]
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:805)
~[na:1.6.0_20]
at sun.security.ssl.AppInputStream.read(AppInputStream.java:94)
~[na:1.6.0_20]
... 3 common frames omitted
----------------------------------------------------------------------
Comment By: Ouray Viney (oviney)
Date: 2012-02-14 06:17
Message:
Hi Phillip:
I figured out my issues with the previous patch you supplied. For some
reason, when downloading via GC and FF, the file was corrupted. You won't
be happy to hear that I was forced to download it via IE =(.
I have tested your candidate patch, and I saw the same behavior using FF
10:
CLASSPATH used when starting TCPProxy :
================
set
CLASSPATH=%GRINDERPATH%\lib\patch3484390.jar;%GRINDERPATH%\lib\grinder.jar;%GRINDERPATH%\grinder-artifacts\jython2.5.2rc3\jython.jar;%CLASSPATH%
Note: I tested both the jars, both seem to be fine using the following
test "jar tf <patch.jar>".
Error:
=========
2012-02-14 09:04:06,439 ERROR tcpproxy: UNEXPECTED - No current request
G
m_requestXML=<xml-fragment><ns:time
xmlns:ns="http://grinder.sourceforge.net/tcpproxy/http/1.0">2012-02-14T09:04:06.526-05:00</ns:time><ns:method
xsi:nil="true" xmlns:ns="http://gr
inder.sourceforge.net/tcpproxy/http/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><ns:uri
extends="url2"
xmlns:ns="http://grinder.sourceforge.net/tcpproxy/http/1.0"><
ns:unparsed>/cpotools/apps/ccm/business/account?ticketType=4.3.4.1</ns:unparsed><ns:path><ns:text>/cpotools/apps/ccm/business/account</ns:text></ns:path><ns:query-string><ns:token-
reference
token-id="token_ticketType"/></ns:query-string></ns:uri><ns:headers
xmlns:ns="http://grinder.sourceforge.net/tcpproxy/http/1.0"><ns:header
name="User-Agent" value="Mozill
a/5.0 (Windows NT 6.1; WOW64; rv:10.0.1) Gecko/20100101
Firefox/10.0.1"/><ns:header name="Accept"
value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"/><ns:heade
r name="Accept-Language" value="en-us,en;q=0.5"/><ns:header
name="Accept-Encoding" value="gzip, deflate"/><ns:header name="Referer"
value="http://dungheap.ca/cpo/mc/busines
s/support/helpcentre/commercial_services/unaddressed_admail.jsf"/></ns:headers><ns:description
xmlns:ns="http://grinder.sourceforge.net/tcpproxy/http/1.0">ET
account</ns:descriptio
n><ns:sleep-time
xmlns:ns="http://grinder.sourceforge.net/tcpproxy/http/1.0">194</ns:sleep-time><ns:response
status-code="401" reason-phrase="Unauthorized" xmlns:ns="http://grinder
.sourceforge.net/tcpproxy/http/1.0"/></xml-fragment>
Exception in thread "Filter thread for dungheap.ca:443->127.0.0.1:12001"
java.lang.NullPointerException
at
net.grinder.plugin.http.tcpproxyfilter.ConnectionHandlerImplementation$Request.expectingResponseBody(ConnectionHandlerImplementation.java:399)
at
net.grinder.plugin.http.tcpproxyfilter.ConnectionHandlerImplementation.handleResponse(ConnectionHandlerImplementation.java:277)
at
net.grinder.plugin.http.tcpproxyfilter.ConnectionCache.response(ConnectionCache.java:110)
at
net.grinder.plugin.http.tcpproxyfilter.HTTPResponseFilter.handle(HTTPResponseFilter.java:66)
at
net.grinder.tools.tcpproxy.CompositeFilter.handle(CompositeFilter.java:50)
at
net.grinder.tools.tcpproxy.AbstractTCPProxyEngine$OutputStreamFilterTee.handle(AbstractTCPProxyEngine.java:577)
at
net.grinder.tools.tcpproxy.AbstractTCPProxyEngine$FilteredStreamThread.interruptibleRun(AbstractTCPProxyEngine.java:437)
at
net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:58)
at java.lang.Thread.run(Unknown Source)
The browser showed the following error:
The connection to the server was reset while the page was loading.
----------------------------------------------------------------------
Comment By: Philip Aston (philipa)
Date: 2012-02-13 10:56
Message:
I've added a patch that should fix the problem. Please give it a go.
----------------------------------------------------------------------
Comment By: Philip Aston (philipa)
Date: 2012-02-12 07:05
Message:
Following further testing by Ouray, we've been able to track this down to
the use of FireFox 10 and https.
A plain recording of HTTPS interaction from FF10 shows:
--- www.google.co.uk:443->localhost.localdomain:39112 opened --
--- localhost.localdomain:39112->www.google.co.uk:443 opened --
------ www.google.co.uk:443->localhost.localdomain:39112 ------
G
------ www.google.co.uk:443->localhost.localdomain:39112 ------
ET / HTTP/1.1
Host: www.google.co.uk
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:10.0) Gecko/20100101
Firefox/10.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cookie:
GPC=FW=0:GHV=2:MGLS=0:MGV=0:SG=0:TE=0:TS=0:TV=0:WCYD=0:SIG=knL9H0E5R8onR5e1;
PREF=ID=c282e4e8016945fa:U=6dfcefcd49878ae8:FF=4:LD=en:TM=1169896114:LM=1327831028:FV=2:S=KyOo4WI4OXFgcqzk;
NID=56=pQ3hqAJqUWwVUtmIgniAOMZYb5d8KgY3TVqdGSm1RcQI6yn_HBl5IaZ_tNHGSguQaJhaE80B342p-f5GB5z7-2mRg08h3Wsmh48Rns33_-AF1eHktzf44dF80S4PD41E;
XmarksFirstTime=0;
SID=DQAAAGMBAADIsX9JAxRwaGs8-oFn05wRY95x7RJ-1SlUA2V0YXoo2GZsvaf63XgbbYuyjk22TRcr09XYor5Phcg-hP0lzGGQeBHpsdjCJBKLBaSBmUnLoeVvy71rtVPSXUjT2W5q76KZOk1VutIQWSMVWnco66KN2huQ3Ak7l9v_7-5Jlu4aoUEzpC29oqWJxVDrgwyXRyTTTpv8FsrYiAPoPsrEqN5YhNVL2cg-D__spJHYliFmoFii_9A8F_6jbFX19uA353cdrtAbq53HAUufUNbZeuc9C4NQV8pIi0SWprae7wPH7C1gHn1_F9mNEHqgvbuRHcQHheIY7c3yL93mkgfMikxETt1NmZllNbLfrUonjN0ZzGzJAiHHAzcMR-Q9nPeX1jJ9qFeXvmvwX9utSy1vwdupBgpkKmn4A65113Itp0TAbyAuHpHqFfrLQMlwW892MzOEXAEccstHzUHiR0FCV_8MwEvVbMvWxVfNK7QzaH-HGQ;
HSID=AKo_uCle5aecl1lgp;
MPRF=H4sIAAAAAAAAAKvombzi_RfVLiaGSUwKqakpRilJBgaGJhYpiUYpBoapZpYGZkkWyUlG5iZJyRYTmBkAM3V0PzAAAAA;
SSID=AuiTZYxauUd2Ma_Mh
Cache-Control: max-age=0
----------------------------------------
Note the initial fragment containing just a "G". The Grinder doesn't handle
this. Note this comment I made once upon a time:
//...
protected final class FilteredStreamThread implements
InterruptibleRunnable {
// For simplicity, the filters take a buffer oriented approach.
// This means that they all break at buffer boundaries. Our buffer
// is huge, so we shouldn't practically cause a problem, but the
// network clearly can by giving us message fragments. I consider
// this a bug, we really ought to take a stream oriented approach.
private static final int BUFFER_SIZE = 65536;
Looks like I'll have to fix the handlers to use a stream oriented contract.
----------------------------------------------------------------------
Comment By: Philip Aston (philipa)
Date: 2012-02-04 09:13
Message:
Waiting for Ouray or Zack to try the patch.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3484390&group_id=18598
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/