diff --git a/src/registry/discoverers/index.js b/src/registry/discoverers/index.js index 21de9dcfc..cb681e7b2 100644 --- a/src/registry/discoverers/index.js +++ b/src/registry/discoverers/index.js @@ -38,7 +38,8 @@ function resolve(opt) { let DiscovererClass = getByName(opt); if (DiscovererClass) return new DiscovererClass(); - if (opt.startsWith("redis://")) return new Discoverers.Redis(opt); + if (opt.startsWith("redis://") || opt.startsWith("rediss://")) + return new Discoverers.Redis(opt); if (opt.startsWith("etcd3://")) return new Discoverers.Etcd3(opt); diff --git a/test/unit/registry/discoverers/index.spec.js b/test/unit/registry/discoverers/index.spec.js index 2d497611b..7da6afa3d 100644 --- a/test/unit/registry/discoverers/index.spec.js +++ b/test/unit/registry/discoverers/index.spec.js @@ -60,6 +60,12 @@ describe("Test Discoverers resolver", () => { expect(discoverer.opts.redis).toEqual("redis://redis-server:6379"); }); + it("should resolve Redis reporter from SSL connection string", () => { + const discoverer = Discoverers.resolve("rediss://redis-server:6379"); + expect(discoverer).toBeInstanceOf(Discoverers.Redis); + expect(discoverer.opts.redis).toEqual("rediss://redis-server:6379"); + }); + it("should resolve Redis discoverer from obj", () => { const options = { heartbeatInterval: 8 }; const discoverer = Discoverers.resolve({ type: "Redis", options });