Skip to content

Commit

Permalink
Merge pull request #114 from MaibornWolff/mqtt_insecure
Browse files Browse the repository at this point in the history
Add option to allow insecure SSL for mqtt action
  • Loading branch information
ChristianGmw authored Jul 29, 2021
2 parents 601e449 + 39e5938 commit 1248cc0
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 1248cc0

Please sign in to comment.