1 Reply Latest reply: Apr 27, 2012 9:50 AM by Phani Reddy V RSS

Socket exception while trying to invoke webservice with SSL certificate

Arka Sharma Newbie

Hi,

 

Can any one give me some idea like when this kind of exception comes......Will be really grateful......sorry if this not the right place to ask this question....

 

I am trying to invoke a service from a remote server with SSL context/certificate.

 

The hand-shaking happening, and then its giveing an exception saying

"Software caused connection abort: recv failed" followed by

"Exception sending alert: java.net.SocketException: Software caused connection abort: socket write error".

 

Please find some details of out put from the log below:

 

trigger seeding of SecureRandom

done seeding SecureRandom

Allow unsafe renegotiation: false

Allow legacy hello messages: true

Is initial handshake: true

Is secure renegotiation: false

main, setSoTimeout(60000) called

%% No cached client session

*** ClientHello, TLSv1

RandomCookie:  GMT: 1318140340 bytes = { 235, 164, 178, 103, 177, 30, 63, 44, 230, 96, 174, 248, 187, 124, 33, 168, 167, 75, 208, 167, 223, 143, 125, 8, 155, 81, 176, 152 }

Session ID:  {}

Cipher Suites: [SSL_RSA_WITH_RC4_128_MD5, SSL_RSA_WITH_RC4_128_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_RSA_WITH_DES_CBC_SHA, SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA, SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV, TLS_KRB5_WITH_RC4_128_SHA, TLS_KRB5_WITH_RC4_128_MD5, TLS_KRB5_WITH_3DES_EDE_CBC_SHA, TLS_KRB5_WITH_3DES_EDE_CBC_MD5, TLS_KRB5_WITH_DES_CBC_SHA, TLS_KRB5_WITH_DES_CBC_MD5, TLS_KRB5_EXPORT_WITH_RC4_40_SHA, TLS_KRB5_EXPORT_WITH_RC4_40_MD5, TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA, TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5]

Compression Methods:  { 0 }

***

[write] MD5 and SHA1 hashes:  len = 95

0000: 01 00 00 5B 03 01 4F 91   3A B4 EB A4 B2 67 B1 1E ...[..O.:....g..

0010: 3F 2C E6 60 AE F8 BB 7C   21 A8 A7 4B D0 A7 DF 8F ?,.`....!..K....

0020: 7D 08 9B 51 B0 98 00 00   34 00 04 00 05 00 2F 00 ...Q....4...../.

0030: 33 00 32 00 0A 00 16 00   13 00 09 00 15 00 12 00 3.2.............

0040: 03 00 08 00 14 00 11 00   FF 00 20 00 24 00 1F 00 .......... .$...

0050: 23 00 1E 00 22 00 28 00   2B 00 26 00 29 01 00     #...".(.+.&.)..

main, WRITE: TLSv1 Handshake, length = 95

[write] MD5 and SHA1 hashes:  len = 131

0000: 01 03 01 00 5A 00 00 00   20 00 00 04 01 00 80 00 ....Z... .......

0010: 00 05 00 00 2F 00 00 33   00 00 32 00 00 0A 07 00 ..../..3..2.....

0020: C0 00 00 16 00 00 13 00   00 09 06 00 40 00 00 15  ............@...

0030: 00 00 12 00 00 03 02 00   80 00 00 08 00 00 14 00  ................

0040: 00 11 00 00 FF 00 00 20   00 00 24 00 00 1F 00 00 ....... ..$.....

0050: 23 00 00 1E 00 00 22 00   00 28 00 00 2B 00 00 26 #....."..(..+..&

0060: 00 00 29 4F 91 3A B4 EB   A4 B2 67 B1 1E 3F 2C E6 ..)O.:....g..?,.

0070: 60 AE F8 BB 7C 21 A8 A7   4B D0 A7 DF 8F 7D 08 9B `....!..K.......

0080: 51 B0 98 Q..

main, WRITE: SSLv2 client hello message, length = 131

[Raw write]: length = 133

0000: 80 83 01 03 01 00 5A 00   00 00 20 00 00 04 01 00 ......Z... .....

0010: 80 00 00 05 00 00 2F 00   00 33 00 00 32 00 00 0A ....../..3..2...

0020: 07 00 C0 00 00 16 00 00   13 00 00 09 06 00 40 00  ..............@.

0030: 00 15 00 00 12 00 00 03   02 00 80 00 00 08 00 00 ................

0040: 14 00 00 11 00 00 FF 00   00 20 00 00 24 00 00 1F ......... ..$...

0050: 00 00 23 00 00 1E 00 00   22 00 00 28 00 00 2B 00 ..#....."..(..+.

0060: 00 26 00 00 29 4F 91 3A   B4 EB A4 B2 67 B1 1E 3F .&..)O.:....g..?

0070: 2C E6 60 AE F8 BB 7C 21   A8 A7 4B D0 A7 DF 8F 7D ,.`....!..K.....

0080: 08 9B 51 B0 98 ..Q..

[Raw read]: length = 5

0000: 16 03 01 00 51 ....Q

[Raw read]: length = 81

0000: 02 00 00 4D 03 01 7B 5B   1E E9 E7 D2 C4 78 2B 67 ...M...[.....x+g

0010: A7 9A 24 F7 ED E3 59 03   80 24 7D 43 50 E2 D9 BC ..$...Y..$.CP...

0020: 1C 5C 5C 9F DC 2D 20 4D   2A 01 89 A0 19 25 A6 3A .\\..- M*....%.:

0030: 6A 88 7A 75 F5 7E 2D 74   1C E8 1B DC 47 51 0B EB j.zu..-t....GQ..

0040: F1 89 97 39 26 CE 32 00   05 00 00 05 FF 01 00 01 ...9&.2.........

0050: 00 .

main, READ: TLSv1 Handshake, length = 81

*** ServerHello, TLSv1

 

 

 

at the End the Exception....

 

main, WRITE: TLSv1 Handshake, length = 36

[Raw write]: length = 41

0000: 16 03 01 00 24 75 E7 A7   4C DD E4 35 62 76 A6 1B ....$u..L..5bv..

0010: FF 92 F3 89 A9 9A 4C 24   42 90 55 A9 AA AA BB E4 ......L$B.U.....

0020: AD 16 97 B2 95 E1 84 F0 E7 .........

main, handling exception: java.net.SocketException: Software caused connection abort: recv failed

main, SEND TLSv1 ALERT:  fatal, description = unexpected_message

Padded plaintext before ENCRYPTION:  len = 22

0000: 02 0A 91 A1 FD A8 B0 D3   9C 04 4D 7F 84 1C 98 57 ..........M....W

0010: 7D C8 03 82 1D 5B .....[

main, WRITE: TLSv1 Alert, length = 22

main, Exception sending alert: java.net.SocketException: Software caused connection abort: socket write error

main, called closeSocket()

main, called close()

main, called closeInternal(true)

 

Caused by: java.net.SocketException: Software caused connection abort: recv failed

      at java.net.SocketInputStream.socketRead0(Native Method)

      at java.net.SocketInputStream.read(Unknown Source)

      at com.sun.net.ssl.internal.ssl.InputRecord.readFully(Unknown Source)

      at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)

      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)

      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)

      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)

      at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(Unknown Source)

      at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)

at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown Source)

at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown Source)

at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleHeadersTrustCaching(HTTPConduit.java:2002)

at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.onFirstWrite(HTTPConduit.java:1954)

at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:42)

at org.apache.cxf.io.AbstractThresholdOutputStream.write(AbstractThresholdOutputStream.java:69)

at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2022)

... 11 more

 

Sorry again,...if any one feels I have posted my question at wrong place....

 

Regards,