Skip to content

Commit

Permalink
feat(Wordpress Node): Add option to ignore error when using self sign…
Browse files Browse the repository at this point in the history
…ed certificates (#8199)

## Summary
Adds option to ignore SSL issues to the Wordpress node, This is useful
when using a self signed certificate in a local setup.


## Related tickets and issues
#8151
  • Loading branch information
Joffcom authored Jan 3, 2024
1 parent 5c078f1 commit 65c8e12
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/nodes-base/credentials/WordpressApi.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ export class WordpressApi implements ICredentialType {
default: '',
placeholder: 'https://example.com',
},
{
displayName: 'Ignore SSL Issues',
name: 'allowUnauthorizedCerts',
type: 'boolean',
description: 'Whether to connect even if SSL certificate validation is not possible',
default: false,
},
];

authenticate: IAuthenticateGeneric = {
Expand All @@ -52,6 +59,7 @@ export class WordpressApi implements ICredentialType {
baseURL: '={{$credentials?.url}}/wp-json/wp/v2',
url: '/users',
method: 'GET',
skipSslCertificateValidation: '={{$credentials.allowUnauthorizedCerts}}',
},
};
}
1 change: 1 addition & 0 deletions packages/nodes-base/nodes/Wordpress/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export async function wordpressApiRequest(
qs,
body,
uri: uri || `${credentials.url}/wp-json/wp/v2${resource}`,
rejectUnauthorized: !credentials.allowUnauthorizedCerts,
json: true,
};
options = Object.assign({}, options, option);
Expand Down

0 comments on commit 65c8e12

Please sign in to comment.