Skip to content

Commit 5a6be47

Browse files
committed
Enable SSL by default
Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 2c55d40 commit 5a6be47

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
## Upgrading
88

9-
<!-- Here goes notes on how to upgrade from previous versions, including deprecations and what they should be replaced with -->
9+
- The `parse_grpc_uri` function (and `BaseApiClient` constructor) now enables SSL by default (`ssl=false` should be passed to disable it).
1010

1111
## New Features
1212

src/frequenz/client/base/channel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def parse_grpc_uri(
3030
The URI must have the following format:
3131
3232
```
33-
grpc://hostname[:port][?ssl=false]
33+
grpc://hostname[:port][?ssl=true]
3434
```
3535
3636
A few things to consider about URI components:
@@ -39,7 +39,7 @@ def parse_grpc_uri(
3939
- If the port is omitted, the `default_port` is used.
4040
- If a query parameter is passed many times, the last value is used.
4141
- The only supported query parameter is `ssl`, which must be a boolean value and
42-
defaults to `false`.
42+
defaults to `true`.
4343
- Boolean query parameters can be specified with the following values
4444
(case-insensitive): `true`, `1`, `on`, `false`, `0`, `off`.
4545
@@ -69,7 +69,7 @@ def parse_grpc_uri(
6969
)
7070

7171
options = {k: v[-1] for k, v in parse_qs(parsed_uri.query).items()}
72-
ssl = _to_bool(options.pop("ssl", "false"))
72+
ssl = _to_bool(options.pop("ssl", "true"))
7373
if options:
7474
raise ValueError(
7575
f"Unexpected query parameters {options!r} in the URI '{uri}'",

tests/test_channel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
from frequenz.client.base.channel import parse_grpc_uri
1313

1414
VALID_URLS = [
15-
("grpc://localhost", "localhost", 9090, False),
16-
("grpc://localhost:1234", "localhost", 1234, False),
15+
("grpc://localhost", "localhost", 9090, True),
16+
("grpc://localhost:1234", "localhost", 1234, True),
1717
("grpc://localhost:1234?ssl=true", "localhost", 1234, True),
1818
("grpc://localhost:1234?ssl=false", "localhost", 1234, False),
1919
("grpc://localhost:1234?ssl=1", "localhost", 1234, True),

0 commit comments

Comments
 (0)