Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const strictSSL: boolean = ('true' !== tl.getEndpointDataParameter(endpoint, 'acceptUntrustedCerts', true));
let requestOptions: IHttpRequestOptions = {
ignoreSslError: !strictSSL
};
let proxyUrl: string = tl.getVariable("agent.proxyurl");
if (!!proxyUrl) {
requestOptions.proxy = tl.getHttpProxyConfiguration();
}
const username = tl.getEndpointAuthorizationParameter(endpoint, 'username', false);
const password = tl.getEndpointAuthorizationParameter(endpoint, 'password', false);
var handler = new handlers.BasicCredentialHandler(username, password);
return new HttpClient("JenkinsRestClient", [handler], requestOptions);
}