Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(useSandbox: boolean, _signingKey: string, _signingPassphrase: string, _tlsCertificate: string, _tlsKey: string, _clientId: string) {
this.SANDBOX = useSandbox;
this.apiBasePath = useSandbox ? "https://api.sandbox.ing.com" : "https://api.ing.com";
this.signingKey = _signingKey;
this.signingPassphrase = _signingPassphrase;
this.tlsCert = _tlsCertificate;
this.tlsKey = _tlsKey;
this.clientId = _clientId;
// Create HTTPS agent
this.agent = new https.Agent({
rejectUnauthorized: false,
cert: this.tlsCert,
key: this.tlsKey
});
}
server.listen(1236, function() {
var options = url.parse('https://localhost:1236' + path);
options.agent = new https.Agent(agentOptions);
https.get(options, function(response) {
response.on('data', function(data) {
expect(data.toString()).to.equal(message);
done();
});
});
});
});
configure (options = {}) {
for (let key in options) {
const val = options[key]
this.options[key] = val
}
if (this.options.use_proxy) {
this.agent = new Sock5Agent({
socksHost: this.options.ss_proxy_host || 'localhost',
socksPort: this.options.ss_proxy_port || 1080
})
} else {
this.agent = new Agent()
}
return this
}
function getAgent(config, portConfig) {
let httpAgent = false, httpsAgent = false;
var agentSettings = portConfig.agentSettings || config.agentSettings;
if (agentSettings) {
httpAgent = new http.Agent(agentSettings);
httpsAgent = new https.Agent(agentSettings);
}
return {httpAgent, httpsAgent};
}
constructor({injector, logger, mode, config, httpsAgent}) {
this.injector = injector;
this.config = config || require('./veres-one.config');
this.mode = mode;
this.logger = logger || console;
this.httpsAgent = httpsAgent;
if(mode === 'dev' && !this.httpsAgent) {
this.httpsAgent = new https.Agent({rejectUnauthorized: false});
}
}