Skip to content

Support specifying TLS options in connection string #2024

Open
@vlasky

Description

@vlasky

Discussed in #2023

Originally posted by vlasky February 16, 2022
There is currently no support for specifying custom TLS certificate files as options in the Redis connection string.

If you specify a rediss URL in the connection string, redis.ParseURL() always applies the fixed TLS option ServerName as seen in the code below:

https://github.com/go-redis/redis/blob/997118894af9d4244d4a471f2b317eead9c9ca62/options.go#L269-L271

I am seeking for redis.ParseURL() to be enhanced to support the following crypto/tls configuration options:

TLSCertPEMFile - path/filename of public key and any intermediate certificates in PEM format
TLSKeyPEMFile - path/filename of private key in PEM format
TLSMinVersion - minimum TLS version supported
TLSMaxVersion - maximum TLS version supported
TLSServerName - optionally used to override the default SNI hostname during TLS handshaking
TLSInsecureSkipVerify - if set true, accepts any certificate presented by the server and any host name in that certificate, to only be used for testing

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions