Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Protocol error, got "H" as reply type byte. #1862

Open
troykelly opened this issue Mar 5, 2024 · 2 comments
Open

Protocol error, got "H" as reply type byte. #1862

troykelly opened this issue Mar 5, 2024 · 2 comments

Comments

@troykelly
Copy link

Connecting to Redis over TLS generates:

[ioredis] Unhandled error event: ParserError: Protocol error, got "H" as reply type byte. Please report this.
    at handleError (/workspaces/shop-fail/node_modules/redis-parser/lib/parser.js:190:15)
    at parseType (/workspaces/shop-fail/node_modules/redis-parser/lib/parser.js:304:14)

Given redis-parser is unmaintained (for six years now), it seems counter productive to log the issue there.

@troykelly
Copy link
Author

This is related to #1137
I assume because it's tls requiring sni that ioredis is having the issue.

@troykelly
Copy link
Author

Resolved by passing servername

    // Redis client configuration
    const redisHost = process.env.REDIS_HOST || 'redis'
    const redisPassword = process.env.REDIS_PASSWORD || ''
    // is "REDIS_TLS" truthy
    const redisTls: ConnectionOptions | undefined = process.env.REDIS_TLS
      ? { servername: redisHost }
      : undefined
    const redisOptions: RedisOptions = {
      host: redisHost,
      password: redisPassword,
      tls: redisTls
    }

    this.redisClient = new Redis(redisOptions)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant