Re: SocketException when using localhost

2014-01-10 Thread Nancee Riehl
)
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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

The thing that I could really not understand is why it is a different
behavior when testing locally and remote.
Maybe that something happens to fast when doing the test locally.

I found that when I run tomcat in debug mode and I connect my IDE to it the
delay is sufficent to run the test succesfully...

Really strange...

Best regards,
Nancee



2014/1/9 Christopher Schultz ch...@christopherschultz.net

 -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

2014-01-08 Thread Nancee Riehl
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


Different SSLHandshakeExceptions tomcat 6.0.35 and 7.0.47

2013-12-06 Thread Nancee Riehl
Hi all,

I've implemented my own JSSE-Implemantation to do some special
Client-Certificate Validations.
When I sent a Client Certificate with length 0 I get in tomcat 6.0.35 this
Exception:
javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate

This is good because I can check it in my JUnit-Test.

When I do the same test with tomcat 7.0.47 I get only this Exception:
java.net.SocketException: Software caused connection abort: recv failed

My Implemation for further Certificate Validations is not affected at this
moment.

The Handshake in my own Socket-Factory looks like this:
try {
 super.handshake(sock);
} catch (IOException e) {
 LOGGER.error(e);
throw new SSLHandshakeException(Test);
} catch (Exception e) {
 LOGGER.error(e);
throw new SSLException(e);
}

I've also created wireshark traces there I could see that with tomcat
6.0.35 I get an Alert Message with Level Fatal (2) and Description Bad
Certificate (42)

With tomcat 7.0.47 I get an Encrypted Alert without further information.

Best regards,
Nancee


Re: Different SSLHandshakeExceptions tomcat 6.0.35 and 7.0.47

2013-12-06 Thread Nancee Riehl
Hi all,

I've no found that with tomcat 7.0.19 I get a
javax.net.ssl.SSLHandshakeException:
Received fatal alert: bad_certificate

With tomcat 7.0.20 I get the SocketException.

But I don't understand which change in 7.0.20 could cause my problem?

Best regards,
Nancee


2013/12/6 Nancee Riehl nancee.ri...@gmail.com

 Hi all,

 I've implemented my own JSSE-Implemantation to do some special
 Client-Certificate Validations.
 When I sent a Client Certificate with length 0 I get in tomcat 6.0.35 this
 Exception:
 javax.net.ssl.SSLHandshakeException: Received fatal alert: bad_certificate

 This is good because I can check it in my JUnit-Test.

 When I do the same test with tomcat 7.0.47 I get only this Exception:
 java.net.SocketException: Software caused connection abort: recv failed

 My Implemation for further Certificate Validations is not affected at this
 moment.

 The Handshake in my own Socket-Factory looks like this:
 try {
  super.handshake(sock);
 } catch (IOException e) {
  LOGGER.error(e);
 throw new SSLHandshakeException(Test);
 } catch (Exception e) {
  LOGGER.error(e);
 throw new SSLException(e);
 }

 I've also created wireshark traces there I could see that with tomcat
 6.0.35 I get an Alert Message with Level Fatal (2) and Description Bad
 Certificate (42)

 With tomcat 7.0.47 I get an Encrypted Alert without further information.

 Best regards,
 Nancee