1 Reply Latest reply: Feb 12, 2007 10:41 AM by 807597 RSS

    SSL HandShake problem in Linux

    807597
      Hello

      I have developed an application that opens a SSLSocket to connect to a remote server. It works on windows but not on Linux machines.

      Running the application on Linux machines (RH 7.3, RHEL4.3 and CentOS), I find the following exception when executing "socket.startHandshake()":

      java.net.SocketException: Socket closed
      at java.net.SocketInputStream.socketRead0(Native Method)
      at java.net.SocketInputStream.read(SocketInputStream.java:129)
      at com.sun.net.ssl.internal.ssl.InputRecord.a(DashoA6275)
      at com.sun.net.ssl.internal.ssl.InputRecord.a(DashoA6275)
      at com.sun.net.ssl.internal.ssl.InputRecord.read(DashoA6275)
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.j(DashoA6275)
      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA6275)

      If I run the application using -Djavax.net.debug=ssl, I find that I am being disconnected after the following:

      TSY_AUTH_CONNECTION, WRITE: TLSv1 Handshake, length = 59
      TSY_AUTH_CONNECTION, WRITE: SSLv2 client hello message, length = 77
      TSY_AUTH_CONNECTION, READ: TLSv1 Handshake, length = 74
      *** ServerHello, TLSv1
      RandomCookie: GMT: 1154497186 bytes = { 76, 79, 199, 144, 134, 187, 14, 169, 211, 237, 53, 213, 7, 81, 172, 229, 95, 59, 255, 118, 99, 39, 108, 11, 92, 17, 104, 251 }
      Session ID: {109, 35, 213, 87, 96, 219, 239, 108, 37, 232, 24, 254, 136, 87, 185, 85, 39, 231, 204, 106, 90, 210, 177, 108, 25, 94, 93, 77, 26, 100, 208, 180}
      Cipher Suite: SSL_RSA_WITH_RC4_128_SHA
      Compression Method: 0
      ***
      %% Created: [Session-1, SSL_RSA_WITH_RC4_128_SHA]
      ** SSL_RSA_WITH_RC4_128_SHA

      However, If I do the same on a Windows XP, the connection is established correctly:

      TSY_AUTH_CONNECTION, WRITE: TLSv1 Handshake, length = 73
      TSY_AUTH_CONNECTION, WRITE: SSLv2 client hello message, length = 98
      TSY_AUTH_CONNECTION, READ: TLSv1 Handshake, length = 74
      *** ServerHello, TLSv1
      RandomCookie: GMT: 1154450754 bytes = { 69, 48, 1, 8, 180, 91, 219, 200, 63, 169, 220, 19, 135, 6, 139, 199, 230, 97, 197, 137, 133, 66, 151, 98, 185, 113, 49, 214 }
      Session ID: {133, 29, 72, 210, 35, 193, 122, 24, 247, 221, 37, 71, 15, 127, 81, 168, 189, 202, 211, 46, 85, 237, 187, 118, 145, 173, 205, 14, 141, 156, 149, 177}
      Cipher Suite: SSL_RSA_WITH_RC4_128_SHA
      Compression Method: 0
      ***
      %% Created: [Session-1, SSL_RSA_WITH_RC4_128_SHA]
      ** SSL_RSA_WITH_RC4_128_SHA
      TSY_AUTH_CONNECTION, READ: TLSv1 Handshake, length = 2072
      *** Certificate chainchain [0] = [.........................

      Could anybody please give me a hand with this issue? I am totally lost.

      Thanks in advance