Hello bbs, currently we are trying to set up local cloud for particle device, which are supposed to processing large number of requests per second (>100).
We have updated the local cloud to v4 nodejs. Most of features works great, however there is a small CryptoStream bug popping out randomly (weirdly coming out for every 100~200 request). It is not fatal for low frequency data acquisition, however it is really bad for high frequency data acquisition meaning it will simply break the pip and everything stops for 1~2 seconds.
The error message is:
CryptoStream transform error Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
And after carefully looking into code, I noticed the exception occurred in following code snippet in
/node_modules/spark-protocol/lib/CryptoStream.js
The code snippet can be referred as below:
try {
var cipher = this.getCipher(callback);
cipher.write(chunk);
cipher.end(); // exception occurred here
cipher = null;
if (!this.encrypt) {
this.vi = new Buffer(16);
chunk.copy(this.vi, 0, 0, 16);
}
} catch (ex) {
// error occurred! - bad-decrypt
}
Is it because of the server issues, the firmware or even the bugs in openssl.
For reference the openssl package i installed is:
OpenSSL 1.0.2g 1 Mar 2016
The node version is
node v4.2.6
The npm version is:
npm v3.5.2
Any suggestions will be appreciated!