From a5683bcd07cd579b25355a2a39c6fe8cdb902253 Mon Sep 17 00:00:00 2001 From: Krishna Acondy Date: Fri, 5 Feb 2021 09:33:42 +0000 Subject: [PATCH] fix(insecure-requests): add flag to config --- src/SASjs.ts | 8 ++++++-- src/types/SASjsConfig.ts | 6 ++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/SASjs.ts b/src/SASjs.ts index 835d0e4..06e158e 100644 --- a/src/SASjs.ts +++ b/src/SASjs.ts @@ -21,7 +21,8 @@ const defaultConfig: SASjsConfig = { serverType: ServerType.SasViya, debug: false, contextName: 'SAS Job Execution compute context', - useComputeApi: false + useComputeApi: false, + allowInsecureRequests: false } /** @@ -715,7 +716,10 @@ export default class SASjs { this.sasjsConfig.serverUrl = this.sasjsConfig.serverUrl.slice(0, -1) } - this.requestClient = new RequestClient(this.sasjsConfig.serverUrl) + this.requestClient = new RequestClient( + this.sasjsConfig.serverUrl, + this.sasjsConfig.allowInsecureRequests + ) this.jobsPath = this.sasjsConfig.serverType === ServerType.SasViya diff --git a/src/types/SASjsConfig.ts b/src/types/SASjsConfig.ts index 4a9b041..e83ece0 100644 --- a/src/types/SASjsConfig.ts +++ b/src/types/SASjsConfig.ts @@ -57,4 +57,10 @@ export class SASjsConfig { * triggered using the APIs instead of the Job Execution Web Service broker. */ useComputeApi = false + /** + * Defaults to `false`. + * When set to `true`, the adapter will allow requests to SAS servers that use a self-signed SSL certificate. + * Changing this setting is not recommended. + */ + allowInsecureRequests = false }