Connect Mattermost node to on-premise instance behind firewall

Hi all! We want to create a workflow that automatically creates Mattermost groups to host virtual coffee breaks. We are following this guide: How to host virtual coffee breaks with n8n ☕️ – n8n Blog

We are behind a company firewall, and we have our own self-signed certificates.

Our main issue is that we cannot make the Mattermost node connect to our own on-premise Mattermost instance. The error that we get when the node is executed is :

HTTP Code

SELF_SIGNED_CERT_IN_CHAIN

Stack:
NodeApiError: UNKNOWN ERROR - check the detailed error for more information at Object.httpRequestWithAuthentication (C:\Users\Mustermann\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\NodeExecuteFunctions.ts:1390:9) at processTicksAndRejections (node:internal/process/task_queues:95:5) at Object.post (C:\Users\Mustermann\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-nodes-base\nodes\Mattermost\v1\actions\message\post\execute.ts:85:23) at Object.router (C:\Users\MustermannAppData\Roaming\npm\node_modules\n8n\node_modules\n8n-nodes-base\nodes\Mattermost\v1\actions\router.ts:34:20) at Workflow.runNode (C:\Users\Mustermann\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-workflow\src\Workflow.ts:1270:19) at C:\Users\Mustermann\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\WorkflowExecute.ts:949:29

We tried to see whether there is an option in the Mattermost node to turn off SSL encryption, but we couldn’t find it. We also tested working directly with HTTP Request node, trying to GET our Mattermost instance, with honestly puzzling results. Namely, if we set up the HTTP Request node with all the necessary details, choose OAuth2 API as the authentication type, go to the Credential for OAuth2 API enter our secrets, and finally click on Connect my account, we do manage to connect to our Mattermost successfully.

Then we want to exit this credentials window, and get the message “Close without connecting? You need to connect your credential for it to work”.

Finally, if we try to execute the HTTP Request node itself, the process fails with the following error:

HTTP Code: rejected

Cause:

{

“status”:“rejected”,

“reason”:{

}

}

Stack:
NodeApiError: UNKNOWN ERROR - check the detailed error for more information at Object.execute (C:\Users\Mustermann\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-nodes-base\nodes\HttpRequest\V3\HttpRequestV3.node.ts:1312:12) at Workflow.runNode (C:\Users\Mustermann\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-workflow\src\Workflow.ts:1270:19) at C:\Users\Mustermann\AppData\Roaming\npm\node_modules\n8n\node_modules\n8n-core\src\WorkflowExecute.ts:949:29

Do you maybe know what is the source of these issues, and how can we connect to Mattermost?

Hey @annax,

Welcome to the community :raised_hands:

That looks like the issue will be down to a self signed certificate being used, Give me 30 minutes or so and I will get in a quick fix for it.

Hey @annax,

I have just opened a PR that should resolve this, If you are self hosting with npm you can use that branch.

3 Likes

Fix got released with new version [email protected] got released which includes the GitHub PR 5630.

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