Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL App provide cert and key from memory #1576

Open
dzonerzy opened this issue Feb 10, 2023 · 6 comments
Open

SSL App provide cert and key from memory #1576

dzonerzy opened this issue Feb 10, 2023 · 6 comments
Labels

Comments

@dzonerzy
Copy link

Instead of having cert and key on disk is it possible to provide them from memory?

@uNetworkingAB
Copy link
Contributor

Not right now but you can place files on a ramdisk /tmp usually is

@dzonerzy
Copy link
Author

Actually I'm using uWebsockets on Windows and I need to ship a single executable

@uNetworkingAB
Copy link
Contributor

But the same idea is still valid - just copy out the file as a temporary file with GetTempPath and load it.

@kylepl
Copy link

kylepl commented Mar 9, 2023

In my local fork, I've implemented this support for OpenSSL. Is this a feature you are open to me up-streaming?

My current implementation extends SocketContextOptions to have key_pem_contents, key_pem_length, cert_contents, and cert_length, then uses SSL_CTX_use_certificate and SSL_CTX_use_RSAPrivateKey under the hood.

I assume that there would also be some changes for boringssl, but I haven't looked.

@uNetworkingAB
Copy link
Contributor

Should be the same for boringssl, feel free to PR it in usockets but I need to look at it

@kylepl
Copy link

kylepl commented May 17, 2023

Just a follow-up, that it turned out my implementation was not quite correct (it was only reading the leaf certificate, not the chain), and I've switched away from an implementation that comes from memory - thus I don't plan to proceed with putting out a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants