> For the complete documentation index, see [llms.txt](https://wiki.codeandcompile.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.codeandcompile.com/iiot/iiot-tools/opc-ua/troubleshooting/certificate-error-in-node-red.md).

# Certificate error in Node-RED

### Error:

After using the OPC UA Client node in Node-RED, sometimes you might see “**invalid endpoint Error**” as shown below:

<figure><img src="/files/ArHhCZDCwEqJyNWvOTSw" alt=""><figcaption></figcaption></figure>

### Solution

* You must generate new private\_key.pem using Git Bash terminal
* Install and open [Git bash](https://git-scm.com/downloads) terminal. Type this code: **openssl req -newkey rsa:2048 -nodes -keyout private\_key.pem -x509 -out client\_selfsigned\_cert\_2048.pem**
* Two files will be created in your root folder (C:\Users\\>username>): client\_selfsigned\_cert\_2048.pem and private\_key.pem
* In your documents, create a new folder called Self\_certificate and move the two pem files into this folder
*

```
<figure><img src="/files/JNLfnu1eTsxemIm8JHjU" alt=""><figcaption></figcaption></figure>
```

* Also place a copy of private\_key.pem into following directory: C:\Users\<Username>\AppData\Roaming\node-red-opcua-nodejs\Config\PKI\own\private
* In the edit window of OPC UA client, you must use Local certificate option and provide path for client\_selfsigned\_cert\_2048.pem and private\_key.pem files
* They were both placed in the folder ‘Self\_certificate’ created in Documents folder&#x20;
  * C:\Users\<Username>\OneDrive\Documents\Self\_certificate\client\_selfsigned\_cert\_2048.pem
  * &#x20;C:\Users\<Username>\OneDrive\Documents\Self\_certificate\private\_key.pem
*

```
<figure><img src="/files/JdnDd7BhIdvPkGXdennN" alt=""><figcaption></figcaption></figure>
```

{% hint style="info" %}
Also, it is a good idea to start a new node-red project with Encryption disabled before using the OPC UA Client node
{% endhint %}
