Skip to content

Commit

Permalink
feat(redis-v5): use default port for Redis 6 (#1529)
Browse files Browse the repository at this point in the history
* use default port for redis 6

* prefer_native_tls
  • Loading branch information
jdowning committed Jun 3, 2020
1 parent ffd81cd commit 2ac3390
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/redis-v5/commands/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,13 +128,24 @@ function maybeTunnel (redis, config) {
let bastions = match(config, /_BASTIONS/)
let hobby = redis.plan.indexOf('hobby') === 0
let uri = url.parse(redis.resource_url)
let prefer_native_tls = redis.prefer_native_tls

if (bastions != null) {
return bastionConnect({ uri, bastions, config })
} else {
let client
if (!hobby) {
client = tls.connect({ port: parseInt(uri.port, 10) + 1, host: uri.hostname, rejectUnauthorized: false })
if (prefer_native_tls) {
client = tls.connect({
port: parseInt(uri.port, 10),
host: uri.hostname,
rejectUnauthorized: false
})
} else if (!hobby) {
client = tls.connect({
port: parseInt(uri.port, 10) + 1,
host: uri.hostname,
rejectUnauthorized: false
})
} else {
client = net.connect({ port: uri.port, host: uri.hostname })
}
Expand Down

0 comments on commit 2ac3390

Please sign in to comment.