javascript - Node.js HTTPS request using Elliptic Curve key -


i want build https client connects https server requires mutual authentication. additionally, client key elliptic curve key instead of rsa key. support elliptic curve keys, have recompiled node.js openssl 1.0.2a.

in node.js program, set options specify key , certificate,

var options = { // these necessary if using client certificate authentication key: fs.readfilesync('client-key.pem'), cert: fs.readfilesync('client-cert.pem'), 

and when run it, error:

error: error:0906d06c:pem routines:pem_read_bio:no start line @ error (native) @ object.createsecurecontext (_tls_common.js:110:19) @ object.exports.connect (_tls_wrap.js:854:21) @ agent.createconnection (https.js:84:14) @ agent.createsocket (_http_agent.js:196:16) @ agent.addrequest (_http_agent.js:168:23) @ new clientrequest (_http_client.js:156:16) @ object.exports.request (http.js:51:10) @ exports.request (https.js:138:15) ... 

this indicates node.js not able read ec key. error message similar when openssl attempts read key x509 cert:

openssl x509 -text -in sample.key  unable load certificate 140735234208608:error:0906d06c:pem routines:pem_read_bio:no start     line:pem_lib.c:701:expecting: trusted certificate 

how can force node.js load key ec key?

the ec key loaded once openssl 1.0.2a configured. ensure node.js' openssl version correct.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -