Skip to content

Commit 1ac09e7

Browse files
committed
http: add ssl conflict
CMK-21637 Change-Id: I85e4d21f2c3771527aed6d8e8bc2711cb76fc22f
1 parent 95c9a75 commit 1ac09e7

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

cmk/update_config/http/conflicts.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ def detect_conflicts(
9999
mode_fields=["add_headers"],
100100
host_fields=[],
101101
)
102+
if mode.ssl in ["ssl_1", "ssl_2", "ssl_3"]:
103+
return Conflict(
104+
type_="ssl_incompatible",
105+
mode_fields=["ssl"],
106+
host_fields=[],
107+
)
102108
return MigratableValue.model_validate(value.model_dump())
103109

104110

cmk/update_config/http/v1_scheme.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ class V1Url(BaseModel, extra="forbid"):
7171
"auto", # use with auto-negotiation
7272
"ssl_1_2", # enforce TLS 1.2
7373
"ssl_1_3", # enforce TLS 1.3
74-
# "ssl_1", # enforce TLS 1.0, not supported in V2
75-
# "ssl_2", # enforce SSL 2.0, not supported in V2
76-
# "ssl_3", # enforce SSL 3.0, not supported in V2
74+
"ssl_1", # enforce TLS 1.0
75+
"ssl_2", # enforce SSL 2.0
76+
"ssl_3", # enforce SSL 3.0
7777
]
7878
| None
7979
) = None

tests/unit/cmk/update_config/http/test_migrate.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -991,9 +991,6 @@ def test_migrate_ssl(rule_value: Mapping[str, object], expected: str) -> None:
991991
EXAMPLE_13,
992992
EXAMPLE_14,
993993
EXAMPLE_20,
994-
EXAMPLE_22,
995-
EXAMPLE_23,
996-
EXAMPLE_24,
997994
EXAMPLE_33,
998995
EXAMPLE_44,
999996
EXAMPLE_49,
@@ -1025,6 +1022,30 @@ def test_non_migrateable_rules(rule_value: Mapping[str, object]) -> None:
10251022
host_fields=[],
10261023
),
10271024
),
1025+
(
1026+
EXAMPLE_22,
1027+
Conflict(
1028+
type_="ssl_incompatible",
1029+
mode_fields=["ssl"],
1030+
host_fields=[],
1031+
),
1032+
),
1033+
(
1034+
EXAMPLE_23,
1035+
Conflict(
1036+
type_="ssl_incompatible",
1037+
mode_fields=["ssl"],
1038+
host_fields=[],
1039+
),
1040+
),
1041+
(
1042+
EXAMPLE_24,
1043+
Conflict(
1044+
type_="ssl_incompatible",
1045+
mode_fields=["ssl"],
1046+
host_fields=[],
1047+
),
1048+
),
10281049
],
10291050
)
10301051
def test_detect_conflicts(rule_value: Mapping[str, object], conflict: Conflict) -> None:

0 commit comments

Comments
 (0)