mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-12 13:27:31 -08:00
feat(RSS Read Node): Add support for self signed certificates (#7039)
This commit is contained in:
parent
dfe0fa65f8
commit
3b9f0fed7a
|
@ -44,12 +44,30 @@ export class RssFeedRead implements INodeType {
|
||||||
required: true,
|
required: true,
|
||||||
description: 'URL of the RSS feed',
|
description: 'URL of the RSS feed',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Options',
|
||||||
|
name: 'options',
|
||||||
|
type: 'collection',
|
||||||
|
placeholder: 'Add Option',
|
||||||
|
default: {},
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
displayName: 'Ignore SSL Issues',
|
||||||
|
name: 'ignoreSSL',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false,
|
||||||
|
description: 'Whether to ignore SSL/TLS certificate issues or not',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||||
try {
|
try {
|
||||||
const url = this.getNodeParameter('url', 0) as string;
|
const url = this.getNodeParameter('url', 0) as string;
|
||||||
|
const options = this.getNodeParameter('options', 0);
|
||||||
|
const ignoreSSL = Boolean(options.ignoreSSL);
|
||||||
|
|
||||||
if (!url) {
|
if (!url) {
|
||||||
throw new NodeOperationError(this.getNode(), 'The parameter "URL" has to be set!');
|
throw new NodeOperationError(this.getNode(), 'The parameter "URL" has to be set!');
|
||||||
|
@ -59,7 +77,11 @@ export class RssFeedRead implements INodeType {
|
||||||
throw new NodeOperationError(this.getNode(), 'The provided "URL" is not valid!');
|
throw new NodeOperationError(this.getNode(), 'The provided "URL" is not valid!');
|
||||||
}
|
}
|
||||||
|
|
||||||
const parser = new Parser();
|
const parser = new Parser({
|
||||||
|
requestOptions: {
|
||||||
|
rejectUnauthorized: !ignoreSSL,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
let feed: Parser.Output<IDataObject>;
|
let feed: Parser.Output<IDataObject>;
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue