-
Notifications
You must be signed in to change notification settings - Fork 353
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
error connecting with SSL #183
Comments
Since you enabled
Did you connect Redis with TLS enabled? If you did, you should set TLS options with command line arguments. For example:
You can use these command line arguments to set Regards |
Actually I connected in redis-cli without specifying certificates: Also jedis (Java client) connects and all tests pass without certificates on the same host. |
I think I've figured it out... |
@adobeturchenko Thanks for pointing it out! It seems that this is a new feature for redis-cli, and it has not been supported by hiredis:
So redis-plus-plus cannot skip the verification so far. Sorry for that. I'll keep an eye on this hiredis' progress on this problem, and if hiredis fixes it, I'll make redis-plus-plus supports this feature. Regards |
After another round of research I've found actual missing code in hiredis:
According to OpenSSL: It can be fixed in hiredis or maybe in redis++ similar to how redis-cli is doing it (they also have dependency on hiredis) - construct SSL object inside redis++ and pass it with redisInitiateSSL() (redis++ uses redisInitiateSSLWithContext() and relies on hiredis to deal with SSL as I understand). |
I think it's better to make hiredis to support it, so that redis-plus-plus can be consistent with it. I've created a pull request to hiredis: #927. When it's done, I'll port it to redis-plus-plus. Regards |
Since hiredis already supports skipping certificate verification, I added this support for redis-plus-plus. In order to use this feature, you need to install hiredis v1.1.0 or above with TSL support.
Regards |
I’ll publish a new release these days with some other changes. I’ll let you know when I’m done.
Regards
…________________________________
发件人: Ganesh ***@***.***>
发送时间: Thursday, April 27, 2023 8:14:47 PM
收件人: sewenew/redis-plus-plus ***@***.***>
抄送: sewenew ***@***.***>; Mention ***@***.***>
主题: Re: [sewenew/redis-plus-plus] error connecting with SSL (#183)
@sewenew<https://github.com/sewenew> Can you please release a new version with this change ?
―
Reply to this email directly, view it on GitHub<#183 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACWWTAPXB7GAGOTKOJE6SSLXDJPLPANCNFSM4Y4427CA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I’ve already published a release with this feature.
Regards
…________________________________
发件人: Ganesh ***@***.***>
发送时间: Thursday, April 27, 2023 8:14:47 PM
收件人: sewenew/redis-plus-plus ***@***.***>
抄送: sewenew ***@***.***>; Mention ***@***.***>
主题: Re: [sewenew/redis-plus-plus] error connecting with SSL (#183)
@sewenew<https://github.com/sewenew> Can you please release a new version with this change ?
―
Reply to this email directly, view it on GitHub<#183 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ACWWTAPXB7GAGOTKOJE6SSLXDJPLPANCNFSM4Y4427CA>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
I'm trying to connect to SSL Redis server and getting connection error.
(I tried to connect to the same server using redis-cli with hostname and a password and it works fine)
ConnectionOptions opts;
opts.host = <some_hostname>;
opts.port = 6380;
opts.tls.enabled = true;
opts.password = <some_password>;
Error I got is not very informative:
redis error: Failed to initialize TLS connection: SSL_connect failed: (null)
After modifying hiredis it gave me something better:
redis error: Failed to initialize TLS connection: SSL_connect failed: certificate verify failed
It looks like the code (SSL_get_verify_result(ssl) == 20) refers to:
20 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY: unable to get local issuer certificate
the issuer certificate could not be found: this occurs if the issuer certificate of an untrusted certificate cannot be found.
I'm likely doing something wrong. But what? (again, redis-cli works fine)
The text was updated successfully, but these errors were encountered: