File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ Option | Description
3333` :host ` | The redis-server host IP | ` "127.0.0.1" ` |
3434` :port ` | The redis-server port | ` 6379 ` |
3535` :password ` | The redis-server password | ` "" ` |
36+ ` :ssl ` | The redis-server SSL flag | ` false ` |
3637` :compression_level ` | Compression level applied to serialized terms (` 0 ` - none, ` 9 ` - highest) | ` 0 ` |
3738` :socket_opts ` | The redis-server network layer options | ` [] ` |
3839
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ defmodule Phoenix.PubSub.Redis do
2323 * `:host` - The redis-server host IP, defaults `"127.0.0.1"`
2424 * `:port` - The redis-server port, defaults `6379`
2525 * `:password` - The redis-server password, defaults `""`
26- * `:ssl` - The redis-server ssl option, defaults `false`
26+ * `:ssl` - The redis-server ssl option, defaults `false`, unless the URL scheme is `rediss`
2727 * `:redis_pool_size` - The size of the redis connection pool. Defaults `5`
2828 * `:compression_level` - Compression level applied to serialized terms - from `0` (no compression), to `9` (highest). Defaults `0`
2929 * `:socket_opts` - List of options that are passed to the network layer when connecting to the Redis server. Default `[]`
@@ -111,9 +111,12 @@ defmodule Phoenix.PubSub.Redis do
111111 [ username , password ] -> [ username: username , password: password ]
112112 end
113113
114+ ssl = info . scheme == "rediss"
115+
114116 opts
115117 |> Keyword . merge ( user_opts )
116118 |> Keyword . merge ( host: info . host , port: info . port || @ defaults [ :port ] )
119+ |> Keyword . put ( :ssl , ssl )
117120 end
118121
119122 defp validate_node_name! ( node_name ) do
You can’t perform that action at this time.
0 commit comments