> 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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wiki.codeandcompile.com/iiot/iiot-tools/opc-ua/troubleshooting/certificate-error-in-node-red.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
