Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
aivus opened this issue ยท 1 comments
aivus commented
Hey Igor ๐
I've found that some users are getting Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
error in
Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
File "crypto.js", line 183, col 26, in Decipheriv.final
File "/node_modules/gree-hvac-client/lib/encryption-service.js", line 43, col 42, in EncryptionService.decrypt
return JSON.parse(str + decipher.final('utf8'))
File "/node_modules/gree-hvac-client/lib/client.js", line 291, col 46, in Client._handleResponse
const pack = this._encryptionService.decrypt(message);
File "/node_modules/gree-hvac-client/lib/client.js", line 113, col 52, in Socket._socket.on.message
this._socket.on('message', message => this._handleResponse(message));
File "events.js", line 126, col 13, in emitTwo
File "events.js", line 214, col 7, in Socket.emit
File "dgram.js", line 659, col 8, in UDP.onMessage [as onmessage]
I'm not sure why it happens as I don't have any additional data (wrong encryption key? broken data?), but can we somehow handle this? I mean allow developers who uses this library handle such cases somehow. Because it's happening inside the library now.
inwaar commented
Hi @aivus, the library API returns promises now, there are quite some error classes can be used to handle errors https://github.com/inwaar/gree-hvac-client#classes
Feel free to give feedback on this :-)