Hi,
I'm using the jira-rest-java-client-core 4.0.0 and so far everything has been working just fine (fetching issues, listing, etc.)
However, since my solution is supposed to work in cooperate environment, I need client traffic to go through a HTTP proxy using basic auth.
Unfortunately I fail to see how this can be configurable in the current (latest) JIRA client - even when I try to configure my own (JIRA) httpClient using AsynchronousHttpClientFactory() I cannot provide HttpClientOptions (which actually also does not allow me setting Proxy credentials). And HttpClient does not allow me to configure anything proxy related... so I am kind of stuck...
Do you guys have any example on how to configure this ? I had my hopes up that I could just rely on JIRA client making use of ProxySelector.setDefault(...) - but that does not seem to be the case.
Many thanks in advance,
Br
Alex
Hey Luca,
I got around the limitation of the API by changing proxy settings for the VM:
...
...
private Properties origProp;
private Properties proxyProp;
// store all the original properties
this.origProp = System.getProperties();
// prepare and overwrite the proxy settings
this.proxyProp = new Properties(origProp);
proxyProp.setProperty("http.proxyHost", "myproxy.com");
proxyProp.setProperty("http.proxyPort", "8080");
proxyProp.setProperty("http.proxyUser", "user);
proxyProp.setProperty("http.proxyPassword", "secret");
proxyProp.setProperty("http.nonProxyHosts", "localhost|127.0.0.1");
proxyProp.setProperty("https.proxyHost", "myproxy.com");
proxyProp.setProperty("https.proxyPort", "8080");
proxyProp.setProperty("https.nonProxyHosts", "localhost|127.0.0.1");
proxyProp.setProperty("https.proxyUser", "user");
proxyProp.setProperty("https.proxyPassword", "secret");
...
...
doJIRAStuff();
...
...
System.setProperties(origProp);
...
...
so essentially storing the previous properties, then overwriting them, then setting them, doing JIRA stuff - and finally restoring them.
Its a bit of a hassle as for our network some internal services are not accessible when proxy is enabled so need to enable/disable the proxy for each call. For some reason I couldn't get the nonProxyHosts working ;o(
Cheers,
Alex ;o)
Hey Alexander, I've got the exact same problem. Did you already find a solution for that?
Thanks in advance.
Best wishes Luca
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.