HTTP proxy cannot be configured for Apache HttpClient 4/5 using system properties

Solution Unverified - Updated -


  • I have a web application in JBoss trying to call an external web service through an HTTP proxy using Apache HttpClient 4.3.3.
  • I have tried the following settings to no avail:
  • In

    JAVA_OPTS="$JAVA_OPTS -Dhttp.proxyPort=7070"
  • In standalone.xml:

        <property name="http.proxyHost" value=""></property>
        <property name="http.proxyPort" value="7070"></property>
        <property name="http.nonProxyHosts" value="localhost"></property> 
  • And also in environment:
  • After approximately 60 seconds I get "ERROR 500: Internal Server Error".

  • My application code looks like this:

    CloseableHttpClient httpclient = HttpClients.createDefault();
    URI uri = ...
    HttpGet httpget = new HttpGet(uri);
    CloseableHttpResponse response = httpclient.execute(httpget);


  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x
    • 7.x
  • Apache HttpClient
    • 4.3+
    • 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content