Allow tls_auth_handler to support client side verification only
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 45/100
- Type d'issue
- Fonctionnalité
- Clarté
- Clairement spécifiée
- Activité
- À l'abandon
- Stack technique
- python
- Domaine
- networking, security
Piste de recherche
Commencez au point d’entrée tls_auth_handler et examinez la manière dont son SSLContext est configuré, notamment la construction de HTTPSHandler. Faites fonctionner la vérification réservée au client sans exiger de fichiers de certificat client, tout en conservant le chargement de la chaîne de certificats pour l’utilisation du protocole serveur ; vérifiez que le handler prend toujours en charge les modes de vérification et d’insécurité indiqués.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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)
- Langage dominant
- Python
- Étoiles
- 4.4k
- Forks
- 876
- Merge moyen
- 8 j 4 h
- PR mergées (30 j)
- 1
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de prometheus/client_python
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
prometheus/client_python#1177 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
prometheus/client_python#1210 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 58/100
prometheus/client_python#1199 · 1 réaction ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
prometheus/client_python#1176 ·
-
WSL and MultiProcessCollector Ouverte
Difficulté 1/5 1-3 heures Accessibilité débutants 52/100
prometheus/client_python#1126 · 2 commentaires ·
Toutes les issues de prometheus/client_python
Issues similaires
-
essnmx good first issue
Difficulté 1/5 Moins d'une heure Accessibilité débutants 95/100
-
[Feature] 奇物选择添加优先级 Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Giskard-AI/giskard-oss#2840 · 1 commentaire ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Ouvertearea: repo bug perceived difficulty: 2
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
yeti-platform/yeti#1380 ·