Add config for ignoring SSL errors on BDC queries (#8169)

* Add config for ignoring SSL errors on BDC queries

* Fix error handling in write stream

* Disable tslint check

* Handle promise appropriately

* PR comments

* Change defaults to true
This commit is contained in:
Charles Gagnon
2019-11-01 15:20:47 -07:00
committed by GitHub
parent 08d81927b4
commit abbb1e54da
16 changed files with 100 additions and 46 deletions

View File

@@ -18,6 +18,7 @@ import { WebHDFS, HdfsError } from '../hdfs/webhdfs';
import { PermissionStatus } from '../hdfs/aclEntry';
import { Mount, MountStatus } from '../hdfs/mount';
import { FileStatus, hdfsFileTypeToFileType } from '../hdfs/fileStatus';
import { getIgnoreSslVerificationConfigSetting } from '../util/auth';
const localize = nls.loadMessageBundle();
@@ -143,12 +144,11 @@ export class FileSourceFactory {
options = options && options.host ? FileSourceFactory.removePortFromHost(options) : options;
let requestParams: IRequestParams = options.requestParams ? options.requestParams : {};
if (requestParams.auth || requestParams.isKerberos) {
// TODO Remove handling of unsigned cert once we have real certs in our Knox service
let agentOptions = {
host: options.host,
port: options.port,
path: constants.hdfsRootPath,
rejectUnauthorized: false
rejectUnauthorized: !getIgnoreSslVerificationConfigSetting()
};
let agent = new https.Agent(agentOptions);
requestParams['agent'] = agent;