Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

jira-rest-java-client (JRC) 5.2.1 How to set up http proxy ?

navn
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 9, 2020

Hi,

I'm trying to connect jira-server from the production. Getting error as.

java.net.UnknownHostException: Name or service not known

tried setting proxy using system properties but no luck !!

System.getProperties().put("http.proxyHost", "proxy.example.com"); System.getProperties().put("http.proxyPort", "8080");
System.getProperties().put("https.proxyHost", "proxy.example.com"); System.getProperties().put("https.proxyPort", "8080"); System.getProperties().put("https.proxySet", "true");

 

Using below code to create jira client.

JiraRestClientFactory clientFactory = new AsynchronousJiraRestClientFactory();
JiraRestClient jiraRestClient = clientFactory.createWithBasicHttpAuthentication("url","username","password");

using the jira-rest-java-client-core 5.2.1 and so far everything has been working just fine on local

However, since my solution is supposed to work in cooperate environment, I need client traffic to go through a HTTP proxy.

Unfortunately I fail to see how this can be configurable in the JIRA client - even when I try to configure 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.

 

1 answer

0 votes
Chao Wang
Contributor
November 11, 2021

I have experienced same issue, Have you got a solution for setting the proxy ?

Suggest an answer

Log in or Sign up to answer