Ioredis: Issue with Azure Redis with SSL

Created on 23 Jan 2018  路  8Comments  路  Source: luin/ioredis

When using Azure Redis with the default set to SSL I keep getting the following error:

ioredis:redis status[beneofficeqaredis.redis.cache.windows.net:6380]: [empty] -> connecting +0ms
  ioredis:redis queue command[0] -> ping() +4ms
  ioredis:redis status[40.71.2.86:6380]: connecting -> connect +277ms
  ioredis:redis write command[0] -> auth(aCeG5Wo6BvO393T628hUx4XttcHeTG5Sr7E+9wQ6NNQ=) +7ms
  ioredis:redis write command[0] -> info() +2ms


  ioredis:connection error: Error: read ECONNRESET +10s
[ioredis] Unhandled error event: Error: read ECONNRESET
    at _errnoException (util.js:1022:11)
    at TCP.onread (net.js:615:25)
  ioredis:redis status[40.71.2.86:6380]: connect -> close +1ms
  ioredis:connection reconnect in 2ms +0ms
  ioredis:redis status[40.71.2.86:6380]: close -> reconnecting +1ms
  ioredis:redis status[40.71.2.86:6380]: reconnecting -> connecting +2ms
  ioredis:redis status[40.71.2.86:6380]: connecting -> connect +3ms
  ioredis:redis write command[0] -> auth(aCeG5Wo6BvO393T628hUx4XttcHeTG5Sr7E+9wQ6NNQ=) +0ms
  ioredis:redis write command[0] -> info() +1ms

Sample code

    let redisOptions: any = {};
    if(process.env.REDIS_PASSWORD) {
        redisOptions.password = process.env.REDIS_PASSWORD;
    }

    let client = new Redis(Number.parseInt(process.env.REDIS_PORT), process.env.REDIS_ADDRESS, redisOptions);
    await client.ping();

    client.disconnect();

Now when I enable the non SSL port I do not get any of these issue.

Most helpful comment

Ok, found solution =) Just set tls = true.

{
     port: 6380,
     host: 'your_host.redis.cache.windows.net',
     password: 'your_pass',
     tls: true as any,
}

All 8 comments

Same problem. Did you get it work with SSL?

@JSGuy7 No I have not gotten it to work :(

Ok, found solution =) Just set tls = true.

{
     port: 6380,
     host: 'your_host.redis.cache.windows.net',
     password: 'your_pass',
     tls: true as any,
}

Glad the issue is resolved!

is this a documented option?

@tony-gutierrez Just added. Thank you for pointing this out!

@sushchevskiy thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saschaishikawa picture saschaishikawa  路  4Comments

AdriVanHoudt picture AdriVanHoudt  路  4Comments

kimmobrunfeldt picture kimmobrunfeldt  路  5Comments

pensierinmusica picture pensierinmusica  路  5Comments

dfee picture dfee  路  4Comments