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

OpenSSL Issue #18

Open
AWanderingEngineer opened this issue May 30, 2019 · 3 comments
Open

OpenSSL Issue #18

AWanderingEngineer opened this issue May 30, 2019 · 3 comments

Comments

@AWanderingEngineer
Copy link

AWanderingEngineer commented May 30, 2019

Hi,

First I want to say I'm pretty new at linux and so I apologize in advance is this is a minor issue with an obvious solution. I'm trying to get this package installed and upon running npm install from the node-opcua-logger directory I get several errors having to do with the creation of private keys and certificates using openSSL. I've attached a text file with all the errors (there were several, all related to openSSL). However they all appear to be duplicates of this:

###########OPENSSL ERROR ############
CWD = /home/bmcadmin/node-opcua-logger/node_modules/node-opcua-client
Command failed: "openssl" genrsa  -out "/home/bmcadmin/node-opcua-logger/node_modules/node-opcua-client/certificates/PKI/own/private/private_key.pem" -rand "/home/bmcadmin/node-opcua-logger/node_modules/node-opcua-client/certificates/PKI/own/private/random.rnd" 2048
Can't load /home/bmcadmin/node-opcua-logger/node_modules/node-opcua-client/certificates/PKI/own/private/random.rnd into RNG
139806547309696:error:2406F079:random number generator:RAND_load_file:Cannot open file:../crypto/rand/randfile.c:98:Filename=/home/bmcadmin/node-opcua-logger/node_modules/node-opcua-client/certificates/PKI/own/private/random.rnd
[OPCUA-Logger Errors.txt](https://github.com/coussej/node-opcua-logger/files/3238905/OPCUA-Logger.Errors.txt)

Thanks for any help resolving this issue!

@coussej
Copy link
Owner

coussej commented May 31, 2019

Hi, can you specify some details about your environment?

  • OS?
  • Node version
  • Is openssl installed correctly? Which version?

@Heli4ce
Copy link

Heli4ce commented Jun 24, 2019

I have the same issues, both unexperienced and "Can't load /home....../random.rnd into RNG":
My versions are:

user@computer:~/node-opcua-logger$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.2 LTS
Release: 18.04
Codename: bionic
user@computer:~/node-opcua-logger$ openssl version
OpenSSL 1.1.1 11 Sep 2018
user@computer:~/node-opcua-logger$ node --version
v8.10.0

I don't know how to tell if openssl is correctly installed...

As far as I can understand I miss these files:
/node-opcua-logger/node_modules/node-opcua-client/certificates/PKI/own/private/random.rnd
and
/node-opcua-logger/node_modules/node-opcua-server/certificates/PKI/own/private/random.rnd
and
/node-opcua-logger/node_modules/node-opcua-server-discovery/certificates/PKI/own/private/random.rnd

Thanks!

Resolved by doing this...
sudo openssl genrsa -out "/home/user/node-opcua-logger/node_modules/node-opcua-server-discovery/certificates/PKI/own/private/private_key.pem" 2048
sudo openssl genrsa -out "/home/user/node-opcua-logger/node_modules/node-opcua-server/certificates/PKI/own/private/private_key.pem" 2048
sudo openssl genrsa -out "/home/user/node-opcua-logger/node_modules/node-opcua-client/certificates/PKI/own/private/private_key.pem" 2048
cd /home/user/node-opcua-logger/node_modules/node-opcua-client
node test_helpers/create_certificates.js certificate -s -o certificates/client_selfsigned_cert_1024.pem
cd ../node-opcua-server
node test_helpers/create_certificates.js certificate -s -o certificates/server_selfsigned_cert_2048.pem
cd ../node-opcua-server-discovery/
node test_helpers/create_certificates.js certificate -s -o certificates/server_selfsigned_cert_2048.pem

not sure if the sudo bit on openssl commands is really necessary...

@coussej
Copy link
Owner

coussej commented Oct 25, 2019

Hi @AWanderingEngineer,

certificate generation is done by the underlying node OPCUA library, and I've had problems with it before. Could you try this with the new version (v2) of the logger, which also contains a much more recent version of the node-OPCUA library? Even better, if you download a binary from the release page, you don't need to generate anything yourself.

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

No branches or pull requests

3 participants