JVM arguments for HTTPS nonProxyHosts

妖精的绣舞 提交于 2019-12-06 01:14:29

问题


So I have a fairly loaded env variable for _JAVA_OPTIONS

export _JAVA_OPTIONS="-Dhttp.proxyHost=my-proxy.com -Dhttp.proxyPort=1080 
  -Dhttps.proxyHost=my-proxy.com -Dhttps.proxyPort=1080 
  -DsocksProxyHost=my-socks-proxy.com 
  -Dhttp.nonProxyHosts=\"localhost|127.0.0.1|*.local|*.my-co.com\""

However I couldn't get it to ignore an internal server url when I tried it from Scala code using Apache HTTP client API.

https://username:pwd@server.my-co.com/foo/bar

Do I need to specify a different nonProxyHosts for HTTPS? The documentation didn't specify such a parameter. What am I missing? I am on a Mac.


回答1:


This answer is for the main question, and for whatever reason I originally thought this was ColdFusion specific.

It is rarely documented, but there is an https non proxy host argument you can use:

-Dhttps.nonProxyHosts=

A lot of documentation states that -Dhttp.nonProxyHosts will cover both. For example, that is the case in Coldfusion. In other cases, say Weblogic, you have to have both arguments, both the http and https versions.

For ColdFusion, he reason it doesn't work is that ColdFusion is adding quotes to the -Dhttp.nonProxyHosts argument:

-Dhttp.nonProxyHosts="my-server"

If you don't use quotes you should be good:

-Dhttp.nonProxyHosts=my-server


来源:https://stackoverflow.com/questions/17902830/jvm-arguments-for-https-nonproxyhosts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!