proxy settings global and collection level

This commit is contained in:
Mirko Golze
2023-10-15 20:26:36 +02:00
parent f2bdf2eaf6
commit 6dd6879e8f
7 changed files with 254 additions and 254 deletions

View File

@@ -87,22 +87,22 @@ const runSingleRequest = async function (
const httpsAgentRequestFields = {};
if (insecure) {
httpsAgentRequestFields['rejectUnauthorized'] = false;
}
const caCertArray = [options['cacert'], process.env.SSL_CERT_FILE, process.env.NODE_EXTRA_CA_CERTS];
const caCert = caCertArray.find((el) => el);
if (caCert && caCert.length > 1) {
try {
httpsAgentRequestFields['ca'] = fs.readFileSync(caCert);
} catch (err) {
console.log('Error reading CA cert file:' + caCert, err);
} else {
const caCertArray = [options['cacert'], process.env.SSL_CERT_FILE, process.env.NODE_EXTRA_CA_CERTS];
const caCert = caCertArray.find((el) => el);
if (caCert && caCert.length > 1) {
try {
httpsAgentRequestFields['ca'] = fs.readFileSync(caCert);
} catch (err) {
console.log('Error reading CA cert file:' + caCert, err);
}
}
}
// set proxy if enabled
const proxyEnabled = get(brunoConfig, 'proxy.enabled', false);
const proxyByPass = shouldUseProxy(request.url, get(brunoConfig, 'proxy.noProxy', ''));
if (proxyEnabled && !proxyByPass) {
const shouldProxy = shouldUseProxy(request.url, get(brunoConfig, 'proxy.noProxy', ''));
if (proxyEnabled && shouldProxy) {
let proxyUri;
const interpolationOptions = {
envVars: envVariables,