JAVA Option '-Dhttp.nonProxyHosts' Does Not Work on Windows OS

This Knowledge Base article was written specifically for the Atlassian Server platform. Due to the Functional differences in Atlassian Cloud, the contents of this article cannot be applied to Atlassian Cloud applications.

 

 

Problem

When Stash is running on a Windows OS, if there are more than one host that needs to bypass the outgoing proxy and you have configured Stash to use an outbound proxy with the -Dhttp.nonProxyHosts JVM argument, connections to those sites are not bypassing the proxy and the connection between the application running on those servers and Stash is failing.

Diagnosis

Environment

  • Windows OS only

The error messages in the logs will vary based on what application that you are connecting to.  Removing the -Dhttp.nonProxyHosts setting from the Java arguments allows for Stash to communicate with the servers correctly (but causes features like manage add-ons to loose connection to the Marketplace.

Cause

The -Dhttp.nonProxyHosts setting for Java are defined incorrectly

Resolution

Change the

  • -Dhttp.nonProxyHosts=localhost|additionalhost1|*.yourdoman.com 

or 

  • -Dhttp.nonProxyHosts="localhost\|additionalhost1\|*.yourdomain.com" 

to

  • -Dhttp.nonProxyHosts="localhost|additionalhost1|*.yourdomain.com"

(Note that the entire list of exceptions is enclosed in the " characters and the | (or) is not escaped with the \ character

To change this setting for Stash Running as a process, .

  1. Stop Stash
  2. Edit the <Stash_Install>\bin\setenv.bat file
  3. Modify the -Dhttp.nonProxyHosts setting
  4. Save the file
  5. Start Stash

To change this setting for Stash running as a service:

  1. Stop Stash Service
  2. At a CMD prompt, change to the <Stash_Install>/bin directory
  3. Run tomcat8w.exe //ES//ServiceName (Default ServiceName is AtlassianStash)
  4. Click on the Java Tab
  5. Edit the -Dhttp.nonProxyHosts setting
  6. Save
  7. Start the Stash Service

This KB does not apply to Stash running on Linux OS's.

Last modified on Apr 6, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.