As far as I can see NodeJS TLS does support OpenSSL engines. But it looks like it only supports them for certificates.
My use-case is a private key managed inside an engine. What I would do, e.g. with libcurl is
// load the engine
curl_easy_setopt(curl, CURLOPT_SSLENGINE, "mycoolengine");
// set it as a default engine
curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT, 1L);
// tell libcurl that private key is managed by the engine
curl_easy_setopt(curl, CURLOPT_SSLKEYTYPE, "ENG");
// set key name (arbitrary string, interpreted by the engine)
curl_easy_setopt(curl, CURLOPT_SSLKEY, "myenginekeyname");
With nodejs it goes like:
> tls_ctx = tls.createSecureContext({"clientCertEngine":"mycoolengine", "key":"myenginekeyname"})
Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
at Object.createSecureContext (_tls_common.js:104:17)
So looks like it tries to interpret "myenginekeyname" as PEM. Am I doing something wrong, or is this use-case not supported at all?
Thanks!
As far as I can see NodeJS TLS does support OpenSSL engines. But it looks like it only supports them for certificates.
My use-case is a private key managed inside an engine. What I would do, e.g. with libcurl is
With nodejs it goes like:
So looks like it tries to interpret
"myenginekeyname"as PEM. Am I doing something wrong, or is this use-case not supported at all?Thanks!