[Feature Request]: Add an API to create a `Certificate` object from a `pem` file
Prinzhorn opened this issue · comments
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem Description
Every use of dialog.showCertificateTrustDialog
I've seen uses it to react to some event that passes certificate
as an argument. There doesn't appear to be a way to create a Certificate
from a file (without manually building the object I guess). I want to use dialog.showCertificateTrustDialog
to trust certificates generated by mitmproxy. What I have are *.pem
files.
Proposed Solution
I'm not sure where this belongs, certainly not in the dialog
namespaces. Maybe import { Certificate } from 'electron';
and have a static method on it like Certificate.fromFile()
.
Alternatives Considered
I assume it's possible to parse the file manually and re-create whatever shape electron expects the object to be. Or is {data}
actually enough for showCertificateTrustDialog
and all other fields are irrelevant? I don't have access to Windows or Mac right now to test it.
Additional Information
No response