mikakaraila / node-red-contrib-opcua

A Node-RED node to communicate OPC UA. Uses node-opcua library.
Other
215 stars 197 forks source link

Cannot locate certificate file #21

Closed dharmeshpurohit closed 5 years ago

dharmeshpurohit commented 7 years ago

Hi ,

I am trying to create OPC UA Browser using node-red and I am following example https://www.youtube.com/watch?v=LaUmhhMdoyY

I am trying to connect to PLC system and Allen-Bradley ControlLogix Ethernet - ControlLogix 5500 using

opc.tcp://MyIPAddress:44818

When I try to view the UI Page what I have developed I am getting following error and I have no idea what does it mean.

Error: cannot locate certificate file C:\Users\\AppData\Roaming\npm\node_modules\node-red-contrib-opcua\node_modules\node-opcua\certificates\client_selfsigned_cert_1024.pem

Look forward for your reply.

Dharmesh

mikakaraila commented 7 years ago

Have you checked that node-opcua installation created that directory and it contains those files? Look certificates directory!

Br, Mika

On Fri, Dec 9, 2016 at 8:04 PM, dharmeshpurohit notifications@github.com wrote:

Hi ,

I am trying to create OPC UA Browser using node-red and I am following example https://www.youtube.com/watch?v=LaUmhhMdoyY

I am trying to connect to PLC system and Allen-Bradley ControlLogix Ethernet - ControlLogix 5500 using

opc.tcp://MyIPAddress:44818

When I try to view the UI Page what I have developed I am getting following error and I have no idea what does it mean.

Error: cannot locate certificate file C:\Users\AppData\ Roaming\npm\node_modules\node-red-contrib-opcua\node_modules\node-opcua\ certificates\client_selfsigned_cert_1024.pem

Look forward for your reply.

Dharmesh

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mikakaraila/node-red-contrib-opcua/issues/21, or mute the thread https://github.com/notifications/unsubscribe-auth/AE8cDJ6IFgBLBtXzrjdqRvbp8ZOAISeLks5rGZhBgaJpZM4LJNDb .

mikakaraila commented 7 years ago

I just notice that there is this issue in the node-opcua open: https://github.com/node-opcua/node-opcua/issues/235

On Fri, Dec 9, 2016 at 8:04 PM, dharmeshpurohit notifications@github.com wrote:

Hi ,

I am trying to create OPC UA Browser using node-red and I am following example https://www.youtube.com/watch?v=LaUmhhMdoyY

I am trying to connect to PLC system and Allen-Bradley ControlLogix Ethernet - ControlLogix 5500 using

opc.tcp://MyIPAddress:44818

When I try to view the UI Page what I have developed I am getting following error and I have no idea what does it mean.

Error: cannot locate certificate file C:\Users\AppData\ Roaming\npm\node_modules\node-red-contrib-opcua\node_modules\node-opcua\ certificates\client_selfsigned_cert_1024.pem

Look forward for your reply.

Dharmesh

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mikakaraila/node-red-contrib-opcua/issues/21, or mute the thread https://github.com/notifications/unsubscribe-auth/AE8cDJ6IFgBLBtXzrjdqRvbp8ZOAISeLks5rGZhBgaJpZM4LJNDb .

dharmeshpurohit commented 7 years ago

Hi ,

In the installation directory the is not certificates folder being created.

Regards,

Dharmesh

On Sat, Dec 10, 2016 at 5:43 AM, Mika Karaila notifications@github.com wrote:

I just notice that there is this issue in the node-opcua open: https://github.com/node-opcua/node-opcua/issues/235

On Fri, Dec 9, 2016 at 8:04 PM, dharmeshpurohit notifications@github.com wrote:

Hi ,

I am trying to create OPC UA Browser using node-red and I am following example https://www.youtube.com/watch?v=LaUmhhMdoyY

I am trying to connect to PLC system and Allen-Bradley ControlLogix Ethernet - ControlLogix 5500 using

opc.tcp://MyIPAddress:44818

When I try to view the UI Page what I have developed I am getting following error and I have no idea what does it mean.

Error: cannot locate certificate file C:\Users\AppData\ Roaming\npm\node_modules\node-red-contrib-opcua\node_modules\node-opcua\ certificates\client_selfsigned_cert_1024.pem

Look forward for your reply.

Dharmesh

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mikakaraila/node-red-contrib-opcua/issues/21, or mute the thread https://github.com/notifications/unsubscribe-auth/ AE8cDJ6IFgBLBtXzrjdqRvbp8ZOAISeLks5rGZhBgaJpZM4LJNDb .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mikakaraila/node-red-contrib-opcua/issues/21#issuecomment-266202378, or mute the thread https://github.com/notifications/unsubscribe-auth/AFRr8NiQ96aAyj2hLlqrDVjuQQZVweYaks5rGpB2gaJpZM4LJNDb .

-- Regards,

Dharmesh Purohit

dharmeshpurohit commented 7 years ago

Hi tried to run node crypto_create_CA.js

but I am getting following error how ever I have installed openssl

set OPENSSL_CONF =C:/Users//AppData/Roaming/npm/node_modules/node-red-contrib-opcua/node_modules/node-opcua/certificates/PKI/CA/conf/caconfig.cnf checking presence of "C:\Users\\AppData\Roaming\npm\node_modules\node-red-contrib-opcua\node_modules\node-opcua\bin\openssl\openssl.exe" openssl seems to be missing and need to be installed process.env.PROCESSOR_ARCHITEW6432 = AMD64 downloading http://indy.fulgan.com/SSL/openssl-1.0.2e-x64_86-win64.zip Server responded with unhandled status: 400

Thanks Dharmesh

biancode commented 7 years ago

May there is a space in your Windows path to the node package. That doesn't work. Like C:/users/my name/....

mikakaraila commented 7 years ago

Hmm, it should be run already in as node-opcua install runs postinstall and it creates all those CA, PKI and other folders under node-opcua. Please check first that under node-opcua is "certificates" directory created.

On Tue, Dec 13, 2016 at 12:23 AM, dharmeshpurohit notifications@github.com wrote:

Hi tried to run node crypto_create_CA.js

but I am getting following error how ever I have installed openssl

set OPENSSL_CONF =C:/Users//AppData/Roaming/npm/node_modules/node-red- contrib-opcua/node_modules/node-opcua/certificates/PKI/ CA/conf/caconfig.cnf checking presence of "C:\Users\AppData\ Roaming\npm\nodemodules\node-red-contrib-opcua\node modules\node-opcua\bin\openssl\openssl.exe" openssl seems to be missing and need to be installed process.env.PROCESSOR_ARCHITEW6432 = AMD64 downloading http://indy.fulgan.com/SSL/openssl-1.0.2e-x64_86-win64.zip Server responded with unhandled status: 400

Thanks Dharmesh

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mikakaraila/node-red-contrib-opcua/issues/21#issuecomment-266572219, or mute the thread https://github.com/notifications/unsubscribe-auth/AE8cDBudsdeNESTJwOGhrzerzbgzfh9Bks5rHclfgaJpZM4LJNDb .

dharmeshpurohit commented 7 years ago

@mikakaraila Under node-opcua "certificates" directory is not getting created, though I can see PKI folder and under that I have "untrusted" folder that has 6b5f82dc738bb783defb466d533813c6d6bd4975.pem file. In addition to this I did tried to run postinstall.js file but it's not generating certificates folder, I can see only PKI folder not even CA.

@biancode - I don't have space in the user name, but my openssl path is : C:\Program Files (x86)\GnuWin32\bin. Do you think that could be an issue?

erossignon commented 7 years ago

Default certificates are created during the installation of the "node-opcua" package. For some reasons, this has failed during the installation on your machine when the installer tried to download the "openssl" binaries. You may have a issue with your local proxy, or the dowload server might have been unavailable. Please check that you can download and access "http://indy.fulgan.com/SSL/openssl-1.0.2j-x64_86-win64.zip"

dharmeshpurohit commented 7 years ago

Yes I am able to download the zip file from this location. But I don't know how use it after downloading.

On Dec 13, 2016 5:44 PM, "Etienne" notifications@github.com wrote:

Default certificates are created during the installation of the "node-opcua" package. For some reasons, this has failed during the installation on your machine when the installer tried to download the "openssl" binaries. You may have a issue with your local proxy, or the dowload server might have been unavailable. Please check that you can download and access "http://indy.fulgan.com/SSL/ openssl-1.0.2j-x64_86-win64.zip"

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mikakaraila/node-red-contrib-opcua/issues/21#issuecomment-266898250, or mute the thread https://github.com/notifications/unsubscribe-auth/AFRr8EnFyGEflDVR2KWFpYf_vYo56pBYks5rHy3cgaJpZM4LJNDb .

mikakaraila commented 7 years ago

Ping, any news / updates?

WilliansDutra commented 7 years ago

Hi, in my case I have the folder certificate but not the file client_selfsigned_cert_1024.pem. How to proceed? win10 machine.

RedCross0815 commented 5 years ago

Iam getting the same error, but in addition to this, i get the error "cant read/.../cer1024.pem" But i can find and open the file...! Any Ideas?

mikakaraila commented 5 years ago

Did you use the latest version? Add some debug "node-red -v FLOW.json" How / in which folder you start node-red? Because there is relative path to find certificates. Like ../../../node-opcua-client/certificates/ etc.

kaushalkumarjoshi commented 5 years ago

Dear @mikakaraila ,

Hi,

I installed node-red-contrib-opcua and tried to create an opc ua server. After getting the certificate error, I soon realized that there is an issue related to path of the certificate. The path has additional 'node_modules' folder which is not there.

error installed path changed running

Kindly resolve the same as it has to be done manually!

Best Regards Kaushal

mikakaraila commented 5 years ago

Yes I know the reason is related to client cetificate file handling. I did not yet fixed server / browse. I try to find some later today at home.

mikakaraila commented 5 years ago

Ok, works in my environment, please test.

kaushalkumarjoshi commented 5 years ago

Now seems to take 2 .node-red in the path:

"Error: Certificate file must exist :C:\Users\Z003Z5MH.node-red.node-red\node_modules\node-opcua-server\certificates\server_selfsigned_cert_2048.pem"

Still an issue :(

mikakaraila commented 5 years ago

Ok, it seems to be some difference in my dev. environment vs. installation environment. I need following information: 1) How node-red-contrib-opcua is installed 2) What is installation folder (absolute path) 3) How you run flow e.q. where you start node-red and how flow JSON is given

Just to find out reason for double .node-red / node_modules. Of course there is relative path now in code.

mikakaraila commented 5 years ago

Ok, it seems to be some difference in my dev. environment vs. installation environment. I need following information: 1) How node-red-contrib-opcua is installed 2) What is installation folder (absolute path) 3) How you run flow e.q. where you start node-red and how flow JSON is given

Just to find out reason for double .node-red / node_modules. Of course there is relative path now in code.

mikakaraila commented 5 years ago

I made server certificate finding with get-installed-path, please test if this will solve the problem.

kaushalkumarjoshi commented 5 years ago

Works as expected!! Cheers :) 👍

kaushalkumarjoshi commented 5 years ago

Have you worked on opc ua timestamps??

mikakaraila commented 5 years ago

Yes and arrays, 2-D tables, alarms & conditions etc. even OPC UA Historical data access. I have implemented our OPC UA Server and OPC UA Client with all features.

Product is going to be released and I have finalized it. More time to do other stuff...

kaushalkumarjoshi commented 5 years ago

Can you tell me the name of this product? :)

mikakaraila commented 5 years ago

It is Valmet DNA (DCS system) and Valmet DNA-OPCUA-Server and Valmet-DNA-OPCUA-Client for Linux and Windows. Realtime communication and other high availability.

kaushalkumarjoshi commented 5 years ago

I am looking for some option where the opc ua client will send the timestamped data and the opc ua server will use the timestamp from data source when publishing data to other clients. Is it possible to do with these nodes?

mikakaraila commented 5 years ago

I will close this one, new own issue for timestamp handling.

smalhao commented 5 years ago

Dear @mikakaraila ,

Hi,

I installed node-red-contrib-opcua and tried to create an opc ua server. After getting the certificate error, I soon realized that there is an issue related to path of the certificate. The path has additional 'node_modules' folder which is not there.

error installed path changed running

Kindly resolve the same as it has to be done manually!

Best Regards Kaushal Can you share your code for me for seeing who you configure the server? Best regards

chrisgray13247 commented 4 years ago

I am experiencing the same certificate issue with OPC UA Server in Docker instance of node-red with OPC UA contribution.

I have searched the node-red session but there is no certificates to be found. Error I get in node-red is:

Error: Certificate file must exist :/data/node_modules/node-opcua-server/certificates/server_selfsigned_cert_2048.pem

I also looked in the following directories: /data/node_modules/node-opcua-server/certificates /data/node_modules/node-opcua-server-discovery/certificates /data/node_modules/node-opcua-client/certificates

How can I get a certificate file to copy to this folder?

Further to this thread, I found that the Event Log in node red reports the following: ########################################### OPENSSL ERROR ########################################### 2020-01-03T02:07:37.148Z [err] CWD = . 2020-01-03T02:07:37.149Z [err] Command failed: "openssl" version 2020-01-03T02:07:37.149Z [err] /bin/sh: openssl: not found

This begs the question of how do I install openssl in a node-red Docker containerÉ

mikakaraila commented 4 years ago

There has been error already in installation, try to solve it first: 2020-01-03T02:07:37.148Z [err] CWD = . 2020-01-03T02:07:37.149Z [err] Command failed: "openssl" version 2020-01-03T02:07:37.149Z [err] /bin/sh: openssl: not found

So node-opcua installation creates self signed certificates and it has failed because script has not found openssl command from your environment.

chrisgray13247 commented 4 years ago

Thank Mikakaraila,

Yes, it would appear that the openssl is not installed within the Docker container (however it is installed on the host). Foregive me for asking, but do you know how to install the Openssl within a Docker container (or where I would find the app to install)?

mikakaraila commented 4 years ago

Did you try something like this? RUN apk upgrade --update-cache --available && \ apk add openssl && \ rm -rf /var/cache/apk/*

jhottell commented 4 years ago

Here are the two lines added to my Dockerfile to install openssl:

USER root
RUN apk add --update openssl && rm -rf /var/cache/apk/*
schimao commented 1 year ago

Hi, I use Docker containers, where are the certificates located and what do I need to specify here?

Absolute path? If so, where is the entry point in Docker containers.

grafik

mikakaraila commented 1 year ago

Code generates them automatically, you can see path at console output.