Support loading keys and certificates as variables (bytes) in particular in the load_cert_chain function
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Proposal:
In MutualTLS Authentication scenarios it's useful to maintain client credential (private_key) confidentiality by allowing loading of the credential from encrypted key archives for example PKCS12. Python Cryptography and other modules allow loading of private keys into memory and at present we need to write those sensitive files to disk temporarily in order to load them into our TLS Client context.
This appears to be the existing code https://github.com/python/cpython/blob/a9c304cf020e2fa3ae78fd88359dfc808c9dd639/Modules/_ssl.c#L3899
if (keyfile && !PyUnicode_FSConverter(keyfile, &keyfile_bytes)) {
if (PyErr_ExceptionMatches(PyExc_TypeError)) {
PyErr_SetString(PyExc_TypeError,
"keyfile should be a valid filesystem path");
}
goto error;
}
Has this already been discussed elsewhere?
There is one somewhat similar feature request relating to loading from PKCS11 tokens. This is not related.
Links to previous discussion of this feature:
No response
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne in Modules/_ssl.c bei der Implementierung von load_cert_chain und der im Issue gezeigten Umwandlung von Dateisystempfaden. Prüfe, wie die aktuelle Funktion Schlüssel- und Zertifikatspfade akzeptiert, und bestimme anschließend die erforderliche API und Testabdeckung für Byte-Eingaben im Speicher. Als abgeschlossen gilt die Arbeit, wenn Anmeldeinformationen aus Bytes geladen werden können, ohne dass temporäre sensible Dateien erforderlich sind.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, python
- Bereich
- authentication, security
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100