# Opc Ua and Certificate

**URL:** https://discourse.nodered.org/t/opc-ua-and-certificate/81023
**Category:** General
**Created:** [4 September 2023 07:56 UTC](https://discourse.nodered.org/t/opc-ua-and-certificate/81023 "2023-09-04T07:56:22Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![matteovi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/matteovi/32/64536_2.png) [@matteovi](https://discourse.nodered.org/u/matteovi)
#### Post date: [4 September 2023 07:56 UTC](https://discourse.nodered.org/t/opc-ua-and-certificate/81023/1 "2023-09-04T07:56:22Z")

</div>

Hi, I have a problem with opc ua connection and certificate.  
This is Console log problem.  
I only try to connect with one item node and one opc client node.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/0/a0808ab9b3b4fe2abab897c52e62f4660198632a.png)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [4 September 2023 08:06 UTC](https://discourse.nodered.org/t/opc-ua-and-certificate/81023/2 "2023-09-04T08:06:34Z")

</div>

Hi. Firstly, do not post screenshots for text.

1. They are not searchable (for future readers with similar problems)
2. They are harder to read than text
3. I cannot copy + paste bits back to ask questions - having to screenshot screenshots is tedious.

So part of the issue _might_ be permissions (storing things on desktop under a user account is never a good thing).

Secondly, do you see all the back slashes?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/b/9b88826ffcde4b1a9e412149d38c79dc5fecafdd.png)

Try specifying file paths with a regular slash `/` e.g. `c:/a_folder_every_user_can_access/my_cert.xyz`

---

<div class="post-metadata">

### Author: ![matteovi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/matteovi/32/64536_2.png) [@matteovi](https://discourse.nodered.org/u/matteovi)
#### Post date: [4 September 2023 08:26 UTC](https://discourse.nodered.org/t/opc-ua-and-certificate/81023/3 "2023-09-04T08:26:57Z")

</div>

Sorry for mistakes.

I've changed all the back slashes and changed the directory but same situation.

```auto
08:25:07.874Z :client_secure_channel_layer :545 xxxxx <<<<<< _on_message_received ERROR requestId= 1 Object response.responseHeader.requestHandle= 0 ServiceFault
08:25:07.875Z :client_base_impl :531 Inner create secure channel has failed serviceResult = BadInternalError (0x80020000)
Client connect error: The connection may have been rejected by server,
Err = ( serviceResult = BadInternalError (0x80020000))
4 Sep 10:25:08 - [warn] [OpcUa-Client:651ed428d71aa592] OpcUaClientNode: Case A: Endpoint does not contain, 1==None 2==Sign 3==Sign&Encrypt, using securityMode: [3]
4 Sep 10:25:08 - [warn] [OpcUa-Client:651ed428d71aa592] OpcUaClientNode: using securityPolicy: ["http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256"]
4 Sep 10:25:08 - [warn] [OpcUa-Client:651ed428d71aa592] OpcUaClientNode: Case B: UserName & password does not match to server (needed by Sign or SignAndEncrypt), check username: undefined and password: undefined
4 Sep 10:25:08 - [warn] [OpcUa-Client:651ed428d71aa592] OpcUaClientNode: Case C: With Sign you cannot use SecurityPolicy None!!
4 Sep 10:25:08 - [warn] [OpcUa-Client:651ed428d71aa592] OpcUaClientNode: Invalid endpoint parameters:
4 Sep 10:25:08 - [error] [OpcUa-Client:651ed428d71aa592] Client node error on: error: ["Wrong endpoint parameters: {\"id\":\"01cb127cd282b3df\",\"type\":\"OpcUa-Endpoint\",\"_closeCallbacks\":[],\"_inputCallback\":null,\"_inputCallbacks\":null,\"wires\":[],\"_wireCount\":0,\"credentials\":{},\"endpoint\":\"opc.tcp://192.168.1.200:4840/\",\"securityPolicy\":\"Basic256Sha256\",\"securityMode\":\"SignAndEncrypt\",\"login\":false,\"none\":false,\"usercert\":true,\"userCertificate\":\"C:\\\\Users\\\\Administrator\\\\Desktop\\\\opcua\\\\user\\\\opcua-user-cert-20230901-105422.der\",\"userPrivatekey\":\"C:\\\\Users\\\\Administrator\\\\Desktop\\\\opcua\\\\user\\\\opcua-user-cert-20230901-105422.key.pem\",\"user\":null,\"password\":null}"]
4 Sep 10:25:08 - [error] [OpcUa-Client:651ed428d71aa592] Invalid endpoint
08:25:08.300Z :client_base_impl :531 Inner create secure channel has failed ClientTCP_transport18: socket has been disconnected by third party
4 Sep 10:25:08 - [error] [OpcUa-Browser:3c737e93cc319db0] Browse node error!
08:25:09.761Z :client_base_impl :531 Inner create secure channel has failed ClientTCP_transport19: socket has been disconnected by third party
Client connect error: The connection may have been rejected by server,
Err = (ClientTCP_transport19: socket has been disconnected by third party)
4 Sep 10:25:09 - [warn] [OpcUa-Client:8f68edae182ffeaf] OpcUaClientNode: Case A: Endpoint does not contain, 1==None 2==Sign 3==Sign&Encrypt, using securityMode: [3]
4 Sep 10:25:09 - [warn] [OpcUa-Client:8f68edae182ffeaf] OpcUaClientNode: using securityPolicy: ["http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256"]
4 Sep 10:25:09 - [warn] [OpcUa-Client:8f68edae182ffeaf] OpcUaClientNode: Case B: UserName & password does not match to server (needed by Sign or SignAndEncrypt), check username: undefined and password: undefined
4 Sep 10:25:09 - [warn] [OpcUa-Client:8f68edae182ffeaf] OpcUaClientNode: Case C: With Sign you cannot use SecurityPolicy None!!
4 Sep 10:25:09 - [warn] [OpcUa-Client:8f68edae182ffeaf] OpcUaClientNode: Invalid endpoint parameters:
4 Sep 10:25:09 - [error] [OpcUa-Client:8f68edae182ffeaf] Client node error on: error: ["Wrong endpoint parameters: {\"id\":\"548f5c3b94ed54b4\",\"type\":\"OpcUa-Endpoint\",\"_closeCallbacks\":[],\"_inputCallback\":null,\"_inputCallbacks\":null,\"wires\":[],\"_wireCount\":0,\"credentials\":{},\"endpoint\":\"opc.tcp://192.168.1.200:4840/HEIDENHAIN/NC\",\"securityPolicy\":\"Basic256Sha256\",\"securityMode\":\"SignAndEncrypt\",\"login\":false,\"none\":false,\"usercert\":true,\"userCertificate\":\"C:/Users/Administrator/AppData/Roaming/node-red-opcua-nodejs/Config/UserPKI/own/certs/opcua-user-cert-20230901-105422.der\",\"userPrivatekey\":\"C:/Users/Administrator/AppData/Roaming/node-red-opcua-nodejs/Config/UserPKI/own/private/opcua-user-cert-20230901-105422.key.pem\",\"user\":null,\"password\":null}"]
4 Sep 10:25:09 - [error] [OpcUa-Client:8f68edae182ffeaf] Invalid endpoint
4 Sep 10:25:10 - [error] [OpcUa-Server:itc640] Disconnect error:

```

---

<div class="post-metadata">

### Author: ![mikakaraila](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mikakaraila/32/37496_2.png) [@mikakaraila](https://discourse.nodered.org/u/mikakaraila)
#### Post date: [19 September 2023 09:21 UTC](https://discourse.nodered.org/t/opc-ua-and-certificate/81023/4 "2023-09-19T09:21:35Z")

</div>

> [@matteovi](#):
>
> `SignAndEncrypt`

You must provide username & password as Sign means you want to use them.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [18 November 2023 09:21 UTC](https://discourse.nodered.org/t/opc-ua-and-certificate/81023/5 "2023-11-18T09:21:55Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
