koalazak / dorita980

Unofficial iRobot Roomba and Braava (i7/i7+, 980, 960, 900, e5, 690, 675, m6, etc) node.js library (SDK) to control your robot
MIT License
932 stars 147 forks source link

AES128-SHA256 cipher not supported by Electron #102

Closed David-Hari closed 4 years ago

David-Hari commented 4 years ago

See https://github.com/electron/electron/issues/20759. Basically, when this library is using in an Electron context (using BoringSSL), it rejects the MQTT connection due to the cipher. I found that changing the cipher allows it to connect, but I have to modify the library to do so. I'm not sure of the consequences of using a different type of cipher, but I'd like it to either use a compatible one or allow me the option of passing my own.

David-Hari commented 4 years ago

So AES128-SHA256 works with all robots but other cyphers don't. Anyway I can add an environment variable to allow you to overwrite this value in dorita980 under your responsability :p.

A parameter passed to the constructor would be easier than an environment variable.

koalazak commented 4 years ago

I know, but I don't want to polute the constructor just for a strange/edge case. Also the cipher is also used in get-password which is not under the constructor. You can use .env files to make it more easy. Or set process.env.ROBOT_CIPHERS = 'AES128-SHA' before use dorita980 in your code. Added ROBOT_CIPHERS env in dorita980@3.1.7. Also updated the documentation with notes about this.

David-Hari commented 4 years ago

Cool, thanks

zachfeldman commented 4 years ago

Very cool thanks @koalazak !