I’m working with the jira-rest-java-client-core library and need help configuring proxy settings. Here’s my current setup:
AsynchronousJiraRestClientFactory clientFactory = new AsynchronousJiraRestClientFactory();
URI serverEndpoint = URI.create("https://my-company-jira.com");
JiraRestClient jiraClient = clientFactory.createWithBasicHttpAuthentication(serverEndpoint, "myUsername", "myPass");
Our company requires proxy authentication to access external services since our Jira instance runs on a public cloud platform. I need to configure the HTTP proxy settings properly.
I attempted to configure the proxy using system properties like this:
This approach works fine when I use HttpURLConnection directly to make API calls, but when I use the JiraRestClient, I get a 407 Proxy Authentication Required error. What’s the correct way to handle proxy configuration with this library?
The jira-rest-java-client-core library uses Apache HttpClient under the hood, but it doesn’t automatically grab Java’s standard proxy system properties for auth. You’ve got to set up the proxy credentials directly through the client factory.
The library lets you configure proxies through the createWithBasicHttpAuthentication method - there’s an overloaded version that takes a ProxyInformation object. Just create a ProxyInformation instance with your proxy details: ProxyInformation proxyInfo = new ProxyInformation(proxyHost, proxyPort, proxyUsername, proxyPassword) then pass it to the factory method.
This way the HttpClient gets properly configured with your proxy credentials instead of hoping it’ll pick up system properties (which it won’t).
same prob here. that 407 error happens cuz the httpclient isn’t gettin your proxy auth right. try using ClientConfiguration to set up your proxy info - way better than system props, those can be real finicky with this client.
I faced this same issue when adjusting our Jira integration for a corporate network. The AsynchronousJiraRestClientFactory does not automatically inherit proxy authentication from system properties; it recognizes only the host and port. I resolved this by using the createWithBasicHttpAuthentication method overload that allows proxy configuration directly. If you want to stick to your current method, consider setting proxy authentication via system properties: System.setProperty("http.proxyUser", "your-proxy-username"); and System.setProperty("http.proxyPassword", "your-proxy-password");. However, this approach can be inconsistent based on your configuration. It’s generally more effective to use ProxyInformation as I suggested. Remember, HttpURLConnection and the HttpClient within the jira-rest-java-client handle proxy authentication differently, which may explain the issues you’re encountering.