convertersystems / opc-ua-samples

Sample HMIs using OPC Unified Architecture (OPC UA) and Visual Studio.
MIT License
107 stars 43 forks source link

node-opcua OPC Server certificate file location #5

Closed abrasat closed 7 years ago

abrasat commented 7 years ago

I tried to start the Workstation.NodeServer, but following error is displayed:

AssertionError: fs.existsSync(this.certificateFile), "Certificate file must exist :" + this.certificateFile

In what folder does the OPC Server search the "server_selfsigned_cert_2048.pem" and "server_key_2048.pem" certificate files ?

awcullen commented 7 years ago

\NodeServer\certificates Edit:

\NodeServer\node_modules\node-opcua\certificates\

To re-generate certificates:

  1. Delete the node_modules directory.
  2. Right-click the npm folder of the project and select "Install missing npm Packages".
  3. Certificate are generated during the installation of the node-opcua package.
abrasat commented 7 years ago

Thank you for the reply. But the client certificates needed for the OPC client component are located in another location, it seems here: \NodeServer\node_modules\node-opcua\certificates\

awcullen commented 7 years ago

I see. You are correct!

~~But if you run node node_modules\node-opcua\bin\crypto_create_CA.js demo then you also get them in \NodeServer\certificates~~

I plan to write a dedicated script to create a certificate with the correct alt subject name (from the ApplicationUri).

Edit: the certificate location is here: \NodeServer\node_modules\node-opcua\certificates\

abrasat commented 7 years ago

Ok, thanks. One more question. Where does the node-opcua server store the list with users and passwords ? (for instance for the Workstation.RobotApp client application)

awcullen commented 7 years ago

For now, the node-server does not store a list of users and passwords. It accepts everyone. RobotApp does store the last username:

Windows.Storage.ApplicationDataContainer roamingSettings = 
    Windows.Storage.ApplicationData.Current.RoamingSettings;
roamingSettings.Values[this.userNameKey] = this.userNameTextBox.Text;