From 01a2160b3b8d36509f4b2871249a3f45358cf692 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 6 Mar 2023 16:27:49 +0000 Subject: [PATCH] feat(Mattermost Node): Add self signed certificate support (#5630) --- .../nodes-base/credentials/MattermostApi.credentials.ts | 8 ++++++++ .../nodes-base/nodes/Mattermost/v1/transport/index.ts | 1 + 2 files changed, 9 insertions(+) diff --git a/packages/nodes-base/credentials/MattermostApi.credentials.ts b/packages/nodes-base/credentials/MattermostApi.credentials.ts index 62cd723607..afddc454fc 100644 --- a/packages/nodes-base/credentials/MattermostApi.credentials.ts +++ b/packages/nodes-base/credentials/MattermostApi.credentials.ts @@ -26,6 +26,13 @@ export class MattermostApi implements ICredentialType { type: 'string', default: '', }, + { + displayName: 'Ignore SSL Issues', + name: 'allowUnauthorizedCerts', + type: 'boolean', + description: 'Whether to connect even if SSL certificate validation is not possible', + default: false, + }, ]; authenticate: IAuthenticateGeneric = { @@ -41,6 +48,7 @@ export class MattermostApi implements ICredentialType { request: { baseURL: '={{$credentials.baseUrl}}/api/v4', url: '/users', + skipSslCertificateValidation: '={{$credentials?.allowUnauthorizedCerts}}', }, }; } diff --git a/packages/nodes-base/nodes/Mattermost/v1/transport/index.ts b/packages/nodes-base/nodes/Mattermost/v1/transport/index.ts index 2a5626edfe..b5f650da5f 100644 --- a/packages/nodes-base/nodes/Mattermost/v1/transport/index.ts +++ b/packages/nodes-base/nodes/Mattermost/v1/transport/index.ts @@ -27,6 +27,7 @@ export async function apiRequest( headers: { 'content-type': 'application/json; charset=utf-8', }, + skipSslCertificateValidation: credentials.allowUnauthorizedCerts as boolean, }; return this.helpers.httpRequestWithAuthentication.call(this, 'mattermostApi', options);