Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cannot set property 'rejectUnauthorized' of undefined #146

Closed
fresheneesz opened this issue Oct 23, 2014 · 4 comments
Closed

Cannot set property 'rejectUnauthorized' of undefined #146

fresheneesz opened this issue Oct 23, 2014 · 4 comments

Comments

@fresheneesz
Copy link
Contributor

The new version is causing this in my tls (wss) code:

 TypeError: Cannot set property 'rejectUnauthorized' of undefined
                at extend (/<omitted>/node_modules/websocket/lib/utils.js:5:20)
                at new (WebSocketClient (/<omitted>/node_modules/websocket/lib/WebSocketClient.js:106:13)
                at <my calling code>

Line 103 of WebSocketClient.js should be config.tlsOptions = {} instead of using delete. @theturtle32

@fresheneesz
Copy link
Contributor Author

I would strongly suggest adding a wss server test to the test suite using self-signed certificates created with the pem module.

@theturtle32
Copy link
Owner

I've fixed this, and I'm ready to do another release, but I can't because of npm/npm#6547
Essentially, ever since I changed my password on npmjs.com I can't log in with the CLI. 😢

@theturtle32
Copy link
Owner

Ok, I was able to get my npm issues fixed, and the new version 1.0.10 has been pushed. Thanks for reporting this so quickly!

I actually had done some testing with TLS before publishing 1.0.9, using a modification of a test script that @johnbrady6 had posted on issue #105. However, in that script, instead of passing { rejectUnauthorized: false } in the tlsOptions, it used this line at the top of the script:

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

So I was consequently able to test the TLS connectivity without testing the passing of TLS options to WebSocketClient 😞

@fresheneesz
Copy link
Contributor Author

Ohh. I'm very surprised at node.js that it has such a sweeping global option like that. Definitely wouldn't use that myself. Thanks for fixing!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants