1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 01:14:36 +00:00

Merge pull request #501 from sasjs/cli-issue-862

Allow self-signed certificates in requests to SAS9
This commit is contained in:
Yury Shkoda
2021-08-06 09:25:32 +03:00
committed by GitHub
3 changed files with 18 additions and 7 deletions

View File

@@ -10,9 +10,13 @@ import { isUrl } from './utils'
export class SAS9ApiClient {
private requestClient: Sas9RequestClient
constructor(private serverUrl: string, private jobsPath: string) {
constructor(
private serverUrl: string,
private jobsPath: string,
allowInsecureRequests: boolean
) {
if (serverUrl) isUrl(serverUrl)
this.requestClient = new Sas9RequestClient(serverUrl, false)
this.requestClient = new Sas9RequestClient(serverUrl, allowInsecureRequests)
}
/**

View File

@@ -749,7 +749,11 @@ export default class SASjs {
)
sasApiClient.debug = this.sasjsConfig.debug
} else if (this.sasjsConfig.serverType === ServerType.Sas9) {
sasApiClient = new SAS9ApiClient(serverUrl, this.jobsPath)
sasApiClient = new SAS9ApiClient(
serverUrl,
this.jobsPath,
this.sasjsConfig.allowInsecureRequests
)
}
} else {
let sasClientConfig: any = null
@@ -944,7 +948,8 @@ export default class SASjs {
else
this.sas9ApiClient = new SAS9ApiClient(
this.sasjsConfig.serverUrl,
this.jobsPath
this.jobsPath,
this.sasjsConfig.allowInsecureRequests
)
}
@@ -965,7 +970,8 @@ export default class SASjs {
this.sas9JobExecutor = new Sas9JobExecutor(
this.sasjsConfig.serverUrl,
this.sasjsConfig.serverType!,
this.jobsPath
this.jobsPath,
this.sasjsConfig.allowInsecureRequests
)
this.computeJobExecutor = new ComputeJobExecutor(

View File

@@ -16,10 +16,11 @@ export class Sas9JobExecutor extends BaseJobExecutor {
constructor(
serverUrl: string,
serverType: ServerType,
private jobsPath: string
private jobsPath: string,
allowInsecureRequests: boolean
) {
super(serverUrl, serverType)
this.requestClient = new Sas9RequestClient(serverUrl, false)
this.requestClient = new Sas9RequestClient(serverUrl, allowInsecureRequests)
}
async execute(sasJob: string, data: any, config: any) {