mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix: Fix issue with key based credentials not being read correctly (#6824)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { IDataObject, IExecuteFunctions, ITriggerFunctions } from 'n8n-workflow';
|
||||
import { sleep } from 'n8n-workflow';
|
||||
import { formatPrivateKey } from '@utils/utilities';
|
||||
|
||||
import * as amqplib from 'amqplib';
|
||||
|
||||
@@ -20,10 +21,17 @@ export async function rabbitmqConnect(
|
||||
if (credentials.ssl === true) {
|
||||
credentialData.protocol = 'amqps';
|
||||
|
||||
optsData.ca = credentials.ca === '' ? undefined : [Buffer.from(credentials.ca as string)];
|
||||
optsData.ca =
|
||||
credentials.ca === '' ? undefined : [Buffer.from(formatPrivateKey(credentials.ca as string))];
|
||||
if (credentials.passwordless === true) {
|
||||
optsData.cert = credentials.cert === '' ? undefined : Buffer.from(credentials.cert as string);
|
||||
optsData.key = credentials.key === '' ? undefined : Buffer.from(credentials.key as string);
|
||||
optsData.cert =
|
||||
credentials.cert === ''
|
||||
? undefined
|
||||
: Buffer.from(formatPrivateKey(credentials.cert as string));
|
||||
optsData.key =
|
||||
credentials.key === ''
|
||||
? undefined
|
||||
: Buffer.from(formatPrivateKey(credentials.key as string));
|
||||
optsData.passphrase = credentials.passphrase === '' ? undefined : credentials.passphrase;
|
||||
optsData.credentials = amqplib.credentials.external();
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import type {
|
||||
import { NodeApiError, NodeOperationError } from 'n8n-workflow';
|
||||
|
||||
import { rabbitmqConnectExchange, rabbitmqConnectQueue } from './GenericFunctions';
|
||||
import { formatPrivateKey } from '@utils/utilities';
|
||||
|
||||
export class RabbitMQ implements INodeType {
|
||||
description: INodeTypeDescription = {
|
||||
@@ -375,12 +376,18 @@ export class RabbitMQ implements INodeType {
|
||||
credentialData.protocol = 'amqps';
|
||||
|
||||
optsData.ca =
|
||||
credentials.ca === '' ? undefined : [Buffer.from(credentials.ca as string)];
|
||||
credentials.ca === ''
|
||||
? undefined
|
||||
: [Buffer.from(formatPrivateKey(credentials.ca as string))];
|
||||
if (credentials.passwordless === true) {
|
||||
optsData.cert =
|
||||
credentials.cert === '' ? undefined : Buffer.from(credentials.cert as string);
|
||||
credentials.cert === ''
|
||||
? undefined
|
||||
: Buffer.from(formatPrivateKey(credentials.cert as string));
|
||||
optsData.key =
|
||||
credentials.key === '' ? undefined : Buffer.from(credentials.key as string);
|
||||
credentials.key === ''
|
||||
? undefined
|
||||
: Buffer.from(formatPrivateKey(credentials.key as string));
|
||||
optsData.passphrase =
|
||||
credentials.passphrase === '' ? undefined : credentials.passphrase;
|
||||
optsData.credentials = amqplib.credentials.external();
|
||||
|
||||
Reference in New Issue
Block a user