rgraciano / echo-sonos

Amazon Echo integration with Sonos
Other
712 stars 234 forks source link

self signed cert error in lambda #112

Open 2stacks opened 7 years ago

2stacks commented 7 years ago

I set everything up and tested and it works great using standard http. I then created some self signed certs and added the variables as required. It looks like everything is working (I actually see an SSL request hit my server) however I'm getting the below lambda error even though I set the REJECT_UNAUTHORIZED = false per the documentation.

{ "version": "1.0", "response": { "outputSpeech": { "type": "PlainText", "text": "The Lambda service encountered an error: self signed certificate" }, "shouldEndSession": true }, "sessionAttributes": {}

rgraciano commented 7 years ago

Grab the latest version of options.js. The last version had a bug that would prevent this from working

2stacks commented 7 years ago

I'm still getting the same error. Do I need to hardcode the options in options.js or should setting Lambda variables be sufficient?

m-gagne commented 7 years ago

It would seem you also need to set NODE_TLS_REJECT_UNAUTHORIZED = "0" to resolve the self-signed cert errors, specifically if you are getting DEPTH_ZERO_SELF_SIGNED_CERT. I could create a PR but would it be best to automatically set this in code when REJECT_UNAUTHORIZED = false, or simply expose the option in the options.sample.js and treat read it via env.