ingore TLS errors if flag ste
This commit is contained in:
1 parent
8f17c6da81
commit
534890c98c
1 file changed
+9
@@ -1,4 +1,6 @@
|
|||||||
import jmespath from "jmespath";
|
import jmespath from "jmespath";
|
||||||
|
import https from "https";
|
||||||
|
|
||||||
const SERVICE_NAME = "NetworkService";
|
const SERVICE_NAME = "NetworkService";
|
||||||
const UPROCK_ENDPOINT = "https://api.uprock.com/checkmate/push";
|
const UPROCK_ENDPOINT = "https://api.uprock.com/checkmate/push";
|
||||||
|
|
||||||
@@ -133,6 +135,7 @@ class NetworkService {
|
|||||||
name,
|
name,
|
||||||
teamId,
|
teamId,
|
||||||
type,
|
type,
|
||||||
|
ignoreTlsErrors,
|
||||||
jsonPath,
|
jsonPath,
|
||||||
matchMethod,
|
matchMethod,
|
||||||
expectedValue,
|
expectedValue,
|
||||||
@@ -141,6 +144,12 @@ class NetworkService {
|
|||||||
|
|
||||||
secret !== undefined && (config.headers = { Authorization: `Bearer ${secret}` });
|
secret !== undefined && (config.headers = { Authorization: `Bearer ${secret}` });
|
||||||
|
|
||||||
|
if (ignoreTlsErrors === true) {
|
||||||
|
config.httpsAgent = new https.Agent({
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const { response, responseTime, error } = await this.timeRequest(() =>
|
const { response, responseTime, error } = await this.timeRequest(() =>
|
||||||
this.axios.get(url, config)
|
this.axios.get(url, config)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user