Allow tls_auth_handler to support client side verification only
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 45/100
- Issue-Typ
- Feature
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- python
- Bereich
- networking, security
Rechercherichtung
Beginnen Sie beim tls_auth_handler-Einstiegspunkt und prüfen Sie, wie dessen SSLContext konfiguriert wird, einschließlich der Konstruktion von HTTPSHandler. Sorgen Sie dafür, dass die Verifizierung nur für den Client funktioniert, ohne Client-Zertifikatsdateien vorauszusetzen, und behalten Sie das Laden der Zertifikatskette für die Verwendung mit dem Serverprotokoll bei; bestätigen Sie, dass der Handler weiterhin die angegebenen Verifizierungs- und unsicheren Modi unterstützt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
The tls_auth_handler supports setting up a mTLS connection with the Prometheus push gateway, but I want only to verify the certificate of the server. In other words, I wish to skip setting certfile and keyfile in the tls_auth_handler method when the protocol is not ssl.PROTOCOL_TLS_SERVER.
The authentication on the server side I will handle differently.
I'd be willing to contribute. Should I add it as a conditional to the current tls_auth_handler method (think this will ), or should I create a new tls_handler method?
Add to current tls_auth_handler:
def tls_auth_handler(
url: str,
method: str,
timeout: Optional[float],
headers: List[Tuple[str, str]],
data: bytes,
certfile: str,
keyfile: str,
cafile: Optional[str] = None,
protocol: int = ssl.PROTOCOL_TLS_CLIENT,
insecure_skip_verify: bool = False,
) -> Callable[[], None]:
"""Handler that implements an HTTPS connection with TLS Auth.
The default protocol (ssl.PROTOCOL_TLS_CLIENT) will also enable
ssl.CERT_REQUIRED and SSLContext.check_hostname by default. This can be
disabled by setting insecure_skip_verify to True.
Both this handler and the TLS feature on pushgateay are experimental."""
context = ssl.SSLContext(protocol=protocol)
if cafile is not None:
context.load_verify_locations(cafile)
else:
context.load_default_certs()
if insecure_skip_verify:
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
if protocol == ssl.PROTOCOL_TLS_SERVER:
context.load_cert_chain(certfile=certfile, keyfile=keyfile)
handler = HTTPSHandler(context=context)
return _make_handler(url, method, timeout, headers, data, handler)
- Vorherrschende Sprache
- Python
- Sterne
- 4.4k
- Forks
- 876
- Ø Merge
- 8 T. 4 Std.
- Gemergte PRs (30 T.)
- 1
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus prometheus/client_python
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
prometheus/client_python#1177 · 1 Kommentar ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
prometheus/client_python#1210 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 58/100
prometheus/client_python#1199 · 1 Reaktion ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
prometheus/client_python#1176 ·
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 52/100
prometheus/client_python#1126 · 2 Kommentare ·
Alle Issues in prometheus/client_python
Ähnliche Issues
-
essnmx good first issue
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 95/100
-
[Feature] 奇物选择添加优先级 Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
syfoud/Simulated_Scepter#174 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Giskard-AI/giskard-oss#2840 · 1 Kommentar ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Offenarea: repo bug perceived difficulty: 2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
yeti-platform/yeti#1380 ·