Skip to content

Commit

Permalink
Add option to allow insecure SSL for mqtt action
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianGmw committed Jul 28, 2021
1 parent 601e449 commit 39e5938
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/model/MqttAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ class MqttAction implements Action {

public allowFailure = false;

private allowInsecure = false;

private url: string;

private username: string;
Expand Down Expand Up @@ -65,6 +67,7 @@ class MqttAction implements Action {
url = actionDef.url,
username = actionDef.username,
password = actionDef.password,
allowInsecure = actionDef.allowInsecure,
topic = actionDef.topic,
durationInSec = actionDef.durationInSec,
expectedNumberOfMessages = actionDef.expectedNumberOfMessages,
Expand Down Expand Up @@ -103,6 +106,7 @@ class MqttAction implements Action {
this.description = desc;
this.invokeEvenOnFail = invokeEvenOnFail;
this.allowFailure = allowFailure;
this.allowInsecure = allowInsecure;
this.diagramConfiguration = diagramConfiguration;
}

Expand Down Expand Up @@ -183,6 +187,7 @@ class MqttAction implements Action {
reconnectPeriod: 1000,
connectTimeout: 30000,
resubscribe: true,
rejectUnauthorized: !this.allowInsecure,
});

client.on('connect', () => {
Expand Down

0 comments on commit 39e5938

Please sign in to comment.