feat(Mattermost Node): Add self signed certificate support (#5630)

This commit is contained in:
Jon 2023-03-06 16:27:49 +00:00 committed by GitHub
parent 45ccdd3bb5
commit 01a2160b3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -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}}',
},
};
}

View file

@ -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);