Skip to content

Commit

Permalink
Add servername option to RabbitMQ for better SNI certificate selection
Browse files Browse the repository at this point in the history
This fix allows to better mitigate ERROR: unable to verify the first certificate.

For more information see amqp-node/amqplib#331
  • Loading branch information
saary committed Mar 6, 2021
1 parent f0c1809 commit 95c093e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/nodes-base/credentials/RabbitMQ.credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,20 @@ export class RabbitMQ implements ICredentialType {
default: '',
description: 'SSL CA Certificates to use.',
},
{
displayName: 'Server Name',
name: 'servername',
type: 'string' as NodePropertyTypes,
displayOptions: {
show: {
ssl: [
true,
],
},
},
default: '',
placeholder: 'localhost',
},
// {
// displayName: 'Client ID',
// name: 'clientId',
Expand Down
2 changes: 2 additions & 0 deletions packages/nodes-base/nodes/RabbitMQ/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export async function rabbitmqConnect(this: IExecuteFunctions | ITriggerFunction
'username',
'password',
'vhost',
'servername'
];

const credentialData: IDataObject = {};
Expand All @@ -30,6 +31,7 @@ export async function rabbitmqConnect(this: IExecuteFunctions | ITriggerFunction
optsData.key = credentials.key === '' ? undefined : Buffer.from(credentials.key as string);
optsData.passphrase = credentials.passphrase === '' ? undefined : credentials.passphrase;
optsData.ca = credentials.ca === '' ? undefined : [Buffer.from(credentials.ca as string)];
optsData.servername = credentials.servername === '' ? undefined : credentials.servername;
optsData.credentials = amqplib.credentials.external();
}

Expand Down

0 comments on commit 95c093e

Please sign in to comment.