Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
OS X w/ Node.js
Description
Using attached thrift-jira-evidence.zip
$ unzip thrift-jira-evidence.zip $ cd thrift-jira-evidence
Note: you'll need a total of three certs: ca.crt, server.crt, and server.key. These have not been provided in the evidence.
Server side reproduce steps
- cd server
- Copy ca.crt to config/ssl/ca.crt
- Copy server.crt to config/ssl/server.crt
- Copy server.key to config/ssl/server.key
- npm install
- NODE_DEBUG="tls" npm start
Server output after server start
> thrift-tls-experiment@0.0.0 start /your/path/to/server > node ./src/node/index.js Thrift service now listening on port 9797
Client side reproduce steps
- cd client
- Copy ca.crt to config/ssl/ca.crt
- npm install
- NODE_DEBUG="tls" npm start
Client output after client start
> thrift-tls-experiment@0.0.0 start /your/path/to/client > node ./src/node/index.js Creating connection host: localhost port: 9797 Creating client Sending: Hello, World! TLS 15599: secure established Response received! Killing connection Success! Hello, World! >> !dlroW ,olleH
Server output after client start
TLS 15547: onhandshakestart TLS 15547: onhandshakedone TLS 15547: secure established Mapping to specific processor call Trace: Inside process_reverse at TermReverserProcessor.process_reverse (/your/path/to/server/src/node/contracts/TermReverser.js:196:11) at TermReverserProcessor.process (/your/path/to/server/src/node/contracts/TermReverser.js:183:39) at /your/path/to/server/node_modules/thrift/lib/thrift/server.js:55:21 at TLSSocket.<anonymous> (/your/path/to/server/node_modules/thrift/lib/thrift/transport.js:63:7) at TLSSocket.emit (events.js:107:17) at readableAddChunk (_stream_readable.js:163:16) at TLSSocket.Readable.push (_stream_readable.js:126:10) at TCP.onread (net.js:529:20) Reversing: Hello, World! call count 1 Mapping to specific processor call Mapping to specific processor call Trace: Inside process_reverse at TermReverserProcessor.process_reverse (/your/path/to/server/src/node/contracts/TermReverser.js:196:11) at TermReverserProcessor.process (/your/path/to/server/src/node/contracts/TermReverser.js:183:39) at /your/path/to/server/node_modules/thrift/lib/thrift/server.js:55:21 at TLSSocket.<anonymous> (/your/path/to/server/node_modules/thrift/lib/thrift/transport.js:63:7) at TLSSocket.emit (events.js:107:17) at readableAddChunk (_stream_readable.js:163:16) at TLSSocket.Readable.push (_stream_readable.js:126:10) at TCP.onread (net.js:529:20) Reversing: Hello, World! call count 2 Mapping to specific processor call
Conclusion: something is resetting the stream position to zero after server-side processing is complete, causing a second complete execution to occur, even though the client only receives one response. This issue does not occur with the equivalent code when TLS has been "turned off". My colleagues and I are having difficulty locating the errant code. Any help is appreciated.
Attachments
Attachments
Issue Links
- relates to
-
THRIFT-3786 Node.js TLS emits 'connect' before connection is ready
- Closed