kevinohara80 / elkington

A node.js module for interfacing with the Elk M1 Gold automation controller
MIT License
22 stars 11 forks source link

Can't connect on secure port #5

Open dvand opened 9 years ago

dvand commented 9 years ago

insecure connection works fine. Maybe an issue with old ssl versions or certificates on the XEP?

~/node $ node elktest.js

events.js:72 throw er; // Unhandled 'error' event ^ Error: socket hang up at SecurePair.error (tls.js:1010:23) at CleartextStream.read as _read at CleartextStream.Readable.read (_stream_readable.js:340:10) at EncryptedStream.write as _write at doWrite (_stream_writable.js:225:10) at writeOrBuffer (_stream_writable.js:215:5) at EncryptedStream.Writable.write (_stream_writable.js:182:11) at write (_stream_readable.js:601:24) at flow (_stream_readable.js:610:7) at Socket.pipeOnReadable (_stream_readable.js:642:5) pi@raspberrypi ~/node $

kevinohara80 commented 9 years ago

Interesting. TBH, it's been a while since I played with this. I'll see if I can find some time tonight to look at this and try it out.

dvand commented 9 years ago

I actually got it to work.

First thing is I was connecting to the secure port but not using a password.

Second thing is I set some of the tls connection options. On Jul 14, 2015 5:35 AM, "kevinohara80" notifications@github.com wrote:

Interesting. TBH, it's been a while since I played with this. I'll see if I can find some time tonight to look at this and try it out.

— Reply to this email directly or view it on GitHub https://github.com/kevinohara80/elkington/issues/5#issuecomment-121196473 .

awmcclain commented 8 years ago

What were your TLS connection options? I'm running into the same problem: socket hangup even though I'm providing U/P.

dvand commented 8 years ago

These are the options i set. I didn't do a lot of experimentation to see which ones were necessary or not

var options = {secureProtocol:'TLSv1_method',rejectUnauthorized:'false',cipher:'AES256-SHA'};

On Wed, Nov 18, 2015 at 10:25 AM, awmcclain notifications@github.com wrote:

What were your TLS connection options? I'm running into the same problem: socket hangup even though I'm providing U/P.

— Reply to this email directly or view it on GitHub https://github.com/kevinohara80/elkington/issues/5#issuecomment-157767593 .