Closed GauriSpears closed 1 year ago
Yiu should not load the key via Engine method. Openssl 3 still supports engines and loading via smth like https://riptutorial.com/openssl/example/16739/load-private-key . The engine should be loaded via Openssl config file.
Thanks, now I clearly see that it's Node.JS issue! It uses PEM_read_bio_PrivateKey both in src/crypto/crypto_keys.cc/ParsePrivateKey for Sign.sign() routine and in src/crypto/crypto_context.cc/SecureContext::SetKey for tls.createSecureContext calls. But it works only in first place.
Debian, OpenSSL 3.0.8, master gost-engine. I'm trying to embed gost TLS support into Node.JS so I recompiled it with shared OpenSSL support. Node.JS loads private key in its tls module only this way:
EVPKeyPointer key(ENGINE_load_private_key(engine.get(), *key_name, nullptr, nullptr));
But when I use it for 'gost' and '/path/to/key.pem' I get an error:As far as I understand It's because gost-engine doesn't implement load function. Can you fix it?