Getting Error for Heroku Redis Addon Connection After Upgrading Redis NPM Version to Latest (4.6.7)
Description
I am maintaining express.js app on Heroku. Because Heroku doesn't support Heroku Redis 4 & 5 soon, I have upgraded the Heroku Redis addon to 7.0, and also upgrade the redis npm module in my codebase of app to latest version (4.6.7). After that the app has been broken, and I am getting following error:
Error accepting a client connection: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
This code snippet is my redis config file:
import * as Redis from 'redis'
import { REDIS_CONNECTION } from './../../constants';
const url = REDIS_CONNECTION;
export const createRedisClient = () => {
return Redis.createClient({
url,
socket: {
tls: true,
rejectUnauthorized: false,
},
})
};
Node.js Version
16.14.2
Redis Server Version
7.0.11
Node Redis Version
4.6.7
Platform
No response
Logs
Error accepting a client connection: error:1408F10B:SSL routines:ssl3_get_record:wrong version number
Same here. I just upgraded from Mini plan to Premium-0 and I am getting a similar error although without SSL part
Error accepting a client connection: (null)
I got it to work. For me, I upgraded to Premium-0 and for that and others in higher, tls must be enabled in the redis client connection.
Hi @qaasimahmad , I am facing simler issue and my sbcription is already Premium-0? any suggestion? should i go for higher sbcription ?
HI @Akhil1304 just ensure that tls is enabled in your redis client connection code.
So you client connection code should have a block like this
client = new Redis(redisUrl, {
maxRetriesPerRequest: null,
enableReadyCheck: false,
tls: {
rejectUnauthorized: false
}
}
can any one tell me how to acheive this redis connection using rediss ssl is required i am writing the code like this const redisClient = createClient({
host:"localhost",
port:6379,
tls:{
key: fs.readFileSync(path.join(__dirname,"../../certificates/key.pem")),
cert: fs.readFileSync(path.join(__dirname,"../../certificates/cert.pem")),
},
}); i have generated private key and cert using open ssl