|
|
@ -131,6 +131,9 @@ class Monitor extends BeanModel {
|
|
|
|
mqttPassword: this.mqttPassword,
|
|
|
|
mqttPassword: this.mqttPassword,
|
|
|
|
authWorkstation: this.authWorkstation,
|
|
|
|
authWorkstation: this.authWorkstation,
|
|
|
|
authDomain: this.authDomain,
|
|
|
|
authDomain: this.authDomain,
|
|
|
|
|
|
|
|
tlsCa: this.tlsCa,
|
|
|
|
|
|
|
|
tlsCert: this.tlsCert,
|
|
|
|
|
|
|
|
tlsKey: this.tlsKey,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -308,6 +311,18 @@ class Monitor extends BeanModel {
|
|
|
|
options.httpsAgent = new https.Agent(httpsAgentOptions);
|
|
|
|
options.httpsAgent = new https.Agent(httpsAgentOptions);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.auth_method === "mtls") {
|
|
|
|
|
|
|
|
if (this.tlsCert !== null && this.tlsCert !== "") {
|
|
|
|
|
|
|
|
options.httpsAgent.options.cert = Buffer.from(this.tlsCert);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.tlsCa !== null && this.tlsCa !== "") {
|
|
|
|
|
|
|
|
options.httpsAgent.options.ca = Buffer.from(this.tlsCa);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.tlsKey !== null && this.tlsKey !== "") {
|
|
|
|
|
|
|
|
options.httpsAgent.options.key = Buffer.from(this.tlsKey);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
log.debug("monitor", `[${this.name}] Axios Options: ${JSON.stringify(options)}`);
|
|
|
|
log.debug("monitor", `[${this.name}] Axios Options: ${JSON.stringify(options)}`);
|
|
|
|
log.debug("monitor", `[${this.name}] Axios Request`);
|
|
|
|
log.debug("monitor", `[${this.name}] Axios Request`);
|
|
|
|
|
|
|
|
|
|
|
@ -813,7 +828,6 @@ class Monitor extends BeanModel {
|
|
|
|
domain: this.authDomain,
|
|
|
|
domain: this.authDomain,
|
|
|
|
workstation: this.authWorkstation ? this.authWorkstation : undefined
|
|
|
|
workstation: this.authWorkstation ? this.authWorkstation : undefined
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
res = await axios.request(options);
|
|
|
|
res = await axios.request(options);
|
|
|
|
}
|
|
|
|
}
|
|
|
|