Re: SocketException when using localhost
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Nancee, On 1/10/14, 5:28 AM, Nancee Riehl wrote: > thank you for your reply! On the tomcat everything works fine, I > can see that the client certificate is checked via my > JSSE-Implementation in both cases! > > This is the stacktrace from my test: > > java.net.SocketException: Software caused connection abort: socket > write error at java.net.SocketOutputStream.socketWrite0(Native > Method) at > java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) > > at java.net.SocketOutputStream.write(SocketOutputStream.java:159) > at > sun.security.ssl.OutputRecord.writeBuffer(OutputRecord.java:377) at > sun.security.ssl.OutputRecord.write(OutputRecord.java:363) at > sun.security.ssl.SSLSocketImpl.writeRecordInternal(SSLSocketImpl.java:830) > > at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:801) > at > sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:672) > at > sun.security.ssl.Handshaker.sendChangeCipherSpec(Handshaker.java:966) > > at > sun.security.ssl.ClientHandshaker.sendChangeCipherAndFinish(ClientHandshaker.java:1087) > > at > sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:1006) > > at > sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:285) > > at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868) > at sun.security.ssl.Handshaker.process_record(Handshaker.java:804) > at > sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016) > at > sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312) > > at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:702) > at > sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122) at > java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) > > at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) > at > org.apache.commons.httpclient.methods.StringRequestEntity.writeRequest(StringRequestEntity.java:146) > > at > org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499) > > at > org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114) > > at > org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096) > > at > org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) > > at > org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) > > at > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) > > at > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) > > at sendAndReceiveMessageFromVsddWithTLS(OCSPTestUtil.java:186) > at testTLSCorruptedClientCert(TLSOcspTest.java:653) You might want to try asking the commons folks who will likely have better answers than here. Perhaps HttpClient is doing something that may cause an error, or mask the "real" error? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJS0BODAAoJEBzwKT+lPKRYfvEP/RyAJ9etdPH0sA60gDW+Jh7F yQlNf3h7nNsAI/fYwdTYyY2Vre+H5QS0GYwy7dz/uAh3THx7X8RR7cN7qGI60Mmb M6b5BzqZdr41cLVupBP5eY/zEZ1CwP4sfvu7iLzmIXVtarUnR9R0+Y14FoZwWlKW YhihVPuGR51jNNQuLkuee4cQTwDEvtor8VxzwM9fSw5v6EzYKkq7hV32r6ju4Rih XHDPbDj8kwfBATqT0u9J6GIei206iAZweGQfXSNQVeVpqycTK3gswnzB8yUJEPU3 Z46KyL7DzB1ksQ7bZ7k7gp+8gPmu9LADPl+DmegpY4N5Zdkor12QQszrDGk8gs6N 71ii2LlSotfE2zQPNcKQaFGMFG2p49xn2gT3ip2OcXEB+vdhjcPKf6RS2p3a1AuI qTOCHmPtOY9Q/VJWVAaMZCoTLOZB4MDskOKHNMiZb1u3UWeuYr19fFh4Ko0Esff2 49TH9qKas7hqYKTaO6VkpN1WJnvF7ipWM128NMgmI82B1WLYYLULKxWpYsS4AgRD oD1QvlmxCpUAC6ypLsXUxNcChVXe8POfQwdHx5a0ihwKGDlQM3bi+C7/Wm8F8g7b MAEBvqZkX0THurSWlt+wrAALvwcdj+VjUQYlGzFPP1lTnGDpAWmzx1oe6ZNUVB2/ LjI/UrNlS+0aNkVv/Frc =Ea2c -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: SocketException when using localhost
Hi Chris, thank you for your reply! On the tomcat everything works fine, I can see that the client certificate is checked via my JSSE-Implementation in both cases! This is the stacktrace from my test: java.net.SocketException: Software caused connection abort: socket write error at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113) at java.net.SocketOutputStream.write(SocketOutputStream.java:159) at sun.security.ssl.OutputRecord.writeBuffer(OutputRecord.java:377) at sun.security.ssl.OutputRecord.write(OutputRecord.java:363) at sun.security.ssl.SSLSocketImpl.writeRecordInternal(SSLSocketImpl.java:830) at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:801) at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:672) at sun.security.ssl.Handshaker.sendChangeCipherSpec(Handshaker.java:966) at sun.security.ssl.ClientHandshaker.sendChangeCipherAndFinish(ClientHandshaker.java:1087) at sun.security.ssl.ClientHandshaker.serverHelloDone(ClientHandshaker.java:1006) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:285) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:868) at sun.security.ssl.Handshaker.process_record(Handshaker.java:804) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1016) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312) at sun.security.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:702) at sun.security.ssl.AppOutputStream.write(AppOutputStream.java:122) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140) at org.apache.commons.httpclient.methods.StringRequestEntity.writeRequest(StringRequestEntity.java:146) at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:499) at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) at sendAndReceiveMessageFromVsddWithTLS(OCSPTestUtil.java:186) at testTLSCorruptedClientCert(TLSOcspTest.java:653) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83) at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41) at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31) at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71) at org.junit.runners.ParentRunner.run(ParentRunner.java:220) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:242) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:137) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) at sun.reflect.NativeMethodAccessorImpl.invoke0
Re: SocketException when using localhost
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Nancee, On 1/8/14, 4:56 AM, Nancee Riehl wrote: > Is this the right mailing-list for my question? Yes! Welcome. > I'm writing a JUNIT-Test to test a connection to tomcat 7.0.47 > over HTTPS/TLSv1.1 with a corrupted Client-Certificate. > > When I run my test against a remote tomcat everything works fine, I > get an SSLHandshakeException. > > When I run the same test against a local tomcat I get this error: > java.net.SocketException: Software caused connection abort: socket > write error > > Do you have an idea why there are diffrent Exceptions? The > configurations and versions of both tomcats are the same. What is the full stack trace? Does the server have any error in its log when the client gets this error? If you don't make arrangements for Java's HttpsURLConnection class, it will choke if the /server/ certificate does not validate (including things like hostname verification). I usually see a different kind of error in these cases, but the real error might be hidden behind something else. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJSzyDnAAoJEBzwKT+lPKRYeXgP/2NWfmCotaovqchxNPcgdKTc u7qHVrwbC4O9kB6Mm90Ukit/YrpAsAggBUrHrvrYO4DCD0IcJXs4cl7fQtGQixau o1TdJX9NbVOYyzh1YrygRhs9LOxUFExICbOb61hIJbgWztAAj5Q2zle5EiiJyivt rusU517dS5+S49WCsXHR1X8FBsX+MY36hnFnTLwPoC2ICz1mPBv3/mXsP43dFHPw fI8HXD3mIPTlVwt09lFe5qyFnHYyydJSTE5OazQcNFdkBBiEREQ0/QaS2mBmIp1A RXQgkx1MtXp/1dMZ26A7l07kg3yISFux8mHG3GlhG8HMJTOunzTq80e4Z5v+h5io 47weHo4sWZc8AmtAxbQACrmFNkW/YVj2UGXHQNKo033NeZBv1q3unoQYz2JY4V4z jgJfjoYFYfXmq4yJveZJ3gfdPxM7WL0KM5381h8IU3E9HkExDJvt7fFKAgcFpIj0 3k9nHL7S/dWWx0mA0ZpD0J3vEmk4rNkHan3skr4+vp6x5QOPY3StbH/Jbw2cR7wD H+6FVgZalb0ezTtfIDcT31fQNowKASy2wbqAZPzgftSvQOvurHEKo88rZy94YDL0 IDLPyMQNTRdQ6xAHKPq3FCdHFsc2Zu0BYfyPwUUbDR3TuGkY22fF4gf6z7x24CKq wNOv5T+Naox1JJZL7f/A =y+5F -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
SocketException when using localhost
Hi all, I'm writing a JUNIT-Test to test a connection to tomcat 7.0.47 over HTTPS/TLSv1.1 with a corrupted Client-Certificate. When I run my test against a remote tomcat everything works fine, I get an SSLHandshakeException. When I run the same test against a local tomcat I get this error: java.net.SocketException: Software caused connection abort: socket write error Do you have an idea why there are diffrent Exceptions? The configurations and versions of both tomcats are the same. Is this the right mailing-list for my question? Best regards Nancee