ra1u / redis-dart

fast redis protocol parser and client
MIT License
84 stars 35 forks source link

How do we connect to an SSL port? #19

Closed abhin-vicks closed 3 years ago

abhin-vicks commented 3 years ago

It works fine when I enable non SSL port in my Azure Cache for Redis. But when I enable SSL port 6380, this is the error I get: _E/flutter ( 5132): [ERROR:flutter/lib/ui/ui_dartstate.cc(166)] Unhandled Exception: SocketException: OS Error: Connection reset by peer, errno = 104, address = RedisAbhinav.redis.cache.windows.net, port = 44938

Code:

RedisConnection conn = new RedisConnection();
    conn
        .connect('SampleName.redis.cache.windows.net', 6380)
        .then((Command command) {
      command.send_object([
        "AUTH",
        "<YourKey>"
      ]).then((var response) {
        print(response);
      });
ra1u commented 3 years ago

We currently do no support other than raw tcp sockets. However you can start by subclassing underlaying socket that is constructed in C onnection. Implementation should not take long but geting right approach can be more tricky.

I am currently absent from computer for 2 weeks. I can take a look at that time if still needed, or if you stuck to make a progress.

Kind regards, Luka.

On Wed, 2 Dec 2020, 10:15 abhin-vicks, notifications@github.com wrote:

It works fine when I enable non SSL port in my Azure Cache for Redis. But when I enable SSL port 6380, this is the error I get: E/flutter ( 5132): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: SocketException: OS Error: Connection reset by peer, errno = 104, address = RedisAbhinav.redis.cache.windows.net http://RedisAbhinav.redis.cache.windows.net, port = 44938

Code:

RedisConnection conn = new RedisConnection(); conn .connect('SampleName.redis.cache.windows.net', 6380) .then((Command command) { command.send_object([ "AUTH", "" ]).then((var response) { print(response); });

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ra1u/redis-dart/issues/19, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGJG2XY5SVRWNCVWQRC5ODSSYAR7ANCNFSM4UKGMHUA .

derrick56007 commented 3 years ago

this would be very useful!

derrick56007 commented 3 years ago

https://github.com/ra1u/redis-dart/pull/21

created a pr

ra1u commented 3 years ago

Implemented in PR and now also released