Skip to Main Content

Cloud Platform

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SSLv3 connection handshake failure with custom node js code

giuseppe.dacunzoApr 5 2016 — edited Apr 28 2016

Hi,

we should make a https connection to a webservice that using client authentication through a certificate.

The "MCS Connector way" has failed Handshake failure (SSLException) with REST connector

So we are trying to make a custom connection through Node js modules(HTTPS and TLS / SSL) using the following code:

       var options = {

       hostname: 'test.test.com',

       port: '443',

       path: '/',

       method: "GET",

       agent : false,

       cert: pem,

       key: key,

       passphrase: '...',

       secureProtocol: "SSLv3_method",

       };

       var req = https.request(options, function(res) {

            ...

       });


But we find anomalous behavior when we upload the custom code on MCS, for example when we try to establish an HTTPS connection, the following exception occurs :

     caused unhandled error:

     Error: 140333144839968:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/s3_pkt.c:1256:SSL alert number 40

         at SlabBuffer.use (tls.js:232:18)

         at CleartextStream.read [as _read] (tls.js:452:29)

         at CleartextStream.Readable.read (_stream_readable.js:320:10)

         at EncryptedStream.write [as _write] (tls.js:366:25)

         at doWrite (_stream_writable.js:223:10)

         at writeOrBuffer (_stream_writable.js:213:5)

         at EncryptedStream.Writable.write (_stream_writable.js:180:11)

         at write (_stream_readable.js:583:24)

         at flow (_stream_readable.js:592:7)

         at Socket.pipeOnReadable (_stream_readable.js:624:5)

         at Socket.EventEmitter.emit (events.js:92:17)

         at emitReadable (stream_readable.js:408:10)

         at emitReadable (_stream_readable.js:404:5)

         at readableAddChunk (_stream_readable.js:165:9)

         at Socket.Readable.push (_stream_readable.js:127:10)

         at TCP.onread (net.js:526:21)

We tried to modify the options "secureProtocol" and "cipher" but the error is always the same, as if the custom code is unable to set other protocols, probably because of the Node.js version that does not support them.

we also have tried using the Node.js TLS module, using the following code

     var options = {

            host:'test.test.com',

           port: '443',

          cert: pem,

            key: key,

           secureProtocol: "SSLv3_method",

           passphrase: '...',

         };

      var client = tls.connect(options, function() {

            ...

      });

but we can not establish a connection:

  MOBILE-28017 An unexpected error occured invoking the API test : com.sun.jersey.api.client.ClientHandlerException: java.net.SocketTimeoutException: Read time out after 60000 millis.

All attempts made in local, with the same code, produce positive results, but MCS is not able to establish this connection.

Can you help me to solve my problem?

thanks,

Giuseppe.

Comments