1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-10 05:40:06 +00:00

chore: removed httpsAgent type + clean up

This commit is contained in:
Saad Jutt
2021-10-07 13:45:50 +05:00
parent 2849e6ed07
commit 6ff8eece7b
11 changed files with 46 additions and 143 deletions

View File

@@ -1,10 +1,10 @@
import * as https from 'https'
import { ServerType } from '@sasjs/utils/types'
import * as NodeFormData from 'form-data'
import { ErrorResponse } from '../types/errors'
import { convertToCSV, isRelativePath } from '../utils'
import { BaseJobExecutor } from './JobExecutor'
import { Sas9RequestClient } from '../request/Sas9RequestClient'
import { HttpsAgent } from '../types/HttpsAgent'
/**
* Job executor for SAS9 servers for use in Node.js environments.
@@ -18,13 +18,10 @@ export class Sas9JobExecutor extends BaseJobExecutor {
serverUrl: string,
serverType: ServerType,
private jobsPath: string,
httpsAgentConfiguration: HttpsAgent
httpsAgentOptions?: https.AgentOptions
) {
super(serverUrl, serverType)
this.requestClient = new Sas9RequestClient(
serverUrl,
httpsAgentConfiguration
)
this.requestClient = new Sas9RequestClient(serverUrl, httpsAgentOptions)
}
async execute(sasJob: string, data: any, config: any) {

View File

@@ -0,0 +1,15 @@
>> self signed certificate in certificate chain
const { key, cert } = serverCert
const httpsServer = https.createServer(
{
key,
cert,
ca: rootCaCert.cert,
requestCert: true,
rejectUnauthorized: false
},
app
)