lujiajing1126 / redis-cli

A Redis-Cli Tool written in typescript for terminal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for SSL

sorvis opened this issue · comments

Would it be possible to add support for SSL?

Would it be possible to add support for SSL?

I suppose the tls support has been added recently. Does #32 (comment) this comment help?

@lujiajing1126

Thank you for the fast response that was exactly what I was looking for! I just missed it since its not in the readme. Created a PR to fix that for future me :-)

After utilizing the --tls switch I'm finding this error about having issues verifying the certificate. Is there anything that can be done to allow it to pass by that certificate and accept it?

"failed - unable to verify the first certificate"

@lujiajing1126

Thank you for the fast response that was exactly what I was looking for! I just missed it since its not in the readme. Created a PR to fix that for future me :-)

After utilizing the --tls switch I'm finding this error about having issues verifying the certificate. Is there anything that can be done to allow it to pass by that certificate and accept it?

"failed - unable to verify the first certificate"

So I understand you are using a custom TLS certificate?

Yes I believe you are right the custom company certificate is what it is complaining about.

Yes I believe you are right the custom company certificate is what it is complaining about.

I will try to add customized options within this week. Or would you like to contribute this feature?

I took a quick look, but I don't exactly see the how to implement. I did try setting this environment variable and it doesn't crash but it does seem to hang so I'm not sure if that's the right path.

export NODE_TLS_REJECT_UNAUTHORIZED=0 && rdcli -h .......

Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.

I took a quick look, but I don't exactly see the how to implement. I did try setting this environment variable and it doesn't crash but it does seem to hang so I'm not sure if that's the right path.

export NODE_TLS_REJECT_UNAUTHORIZED=0 && rdcli -h .......

Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.

Generally speaking, there may be two ways,

  1. Add option to rdcli to skip TLS cert verification,
  2. Add option to rdcli to allow custom certification.

For rdcli, it just exposes options provided by the underlying redis library.

@lujiajing1126 seems like I'm not going to get around to making the change. I did find another work around is to use sclient then redirect the port something like this:

sclient securedHost:123 localhost:123 &

That redirects the traffic locally to make it appear as an unsecured call so the certificate validation is ignored. Given the work around I'm not sure if you would like to update the tool later or if you'd like I could make a PR to update the read-me to mention the work around.

As you said though allowing custom certificates would be good from a security perspective.