From 2c3cc840deb74a4b4c4ccc170af45a9b89b2a143 Mon Sep 17 00:00:00 2001 From: Jake Cohen Date: Mon, 10 Jun 2024 15:44:29 -0700 Subject: [PATCH] allow job-level override --- src/main/java/edu/ohio/ais/rundeck/HttpBuilder.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/edu/ohio/ais/rundeck/HttpBuilder.java b/src/main/java/edu/ohio/ais/rundeck/HttpBuilder.java index a3e218a..261484c 100644 --- a/src/main/java/edu/ohio/ais/rundeck/HttpBuilder.java +++ b/src/main/java/edu/ohio/ais/rundeck/HttpBuilder.java @@ -110,13 +110,6 @@ public boolean isTrusted(X509Certificate[] x509Certificates, String s) throws Ce httpClientBuilder.setSSLHostnameVerifier(new NoopHostnameVerifier()); httpClientBuilder.setSSLContext(sslContextBuilder.build()); } - if(options.containsKey("proxySettings") && Boolean.parseBoolean(options.get("proxySettings").toString())){ - log.log(5, "proxy IP set in job: " + options.get("proxyIP").toString()); - - HttpHost proxy = new HttpHost(options.get("proxyIP").toString(), Integer.valueOf((String)options.get("proxyPort")), "http"); - httpClientBuilder.setProxy(proxy); - } - if(options.get("useSystemProxySettings").equals("true")) { log.log(5, "Using proxy settings set on system"); @@ -124,6 +117,12 @@ public boolean isTrusted(X509Certificate[] x509Certificates, String s) throws Ce httpClientBuilder.setRoutePlanner(new SystemDefaultRoutePlanner(ProxySelector.getDefault())); } + if(options.containsKey("proxySettings") && Boolean.parseBoolean(options.get("proxySettings").toString())){ + log.log(5, "proxy IP set in job: " + options.get("proxyIP").toString()); + + HttpHost proxy = new HttpHost(options.get("proxyIP").toString(), Integer.valueOf((String)options.get("proxyPort")), "http"); + httpClientBuilder.setProxy(proxy); + } return httpClientBuilder.build(); }