How do I configure Eclipse web browser/network settings? - java

I use an "anonproxy" to bypass network restrictions in some public networks, and somehow eclipse managed to configure itself to use it. Even after I disabled the proxy settings in firefox, eclipse still uses it. When I try to stop the proxy service, eclipse simply pops a message saying the proxy refused connections. How do I remove any proxy settings from eclipse??

If you are speaking about the proxy Eclipse uses to access the web, it's in:
Window -> Preferences -> General -> Network Connections

Related

Eclipse Maven is blocked

I tried to use Maven on my company's computer. I use the same issue as in stackoverflow another question. I suppose it is the proxy issue. Does anyone know which link I need to ask security to put into white list to use Maven in eclipse?
Thanks
Peter
You need to set the proxy server in eclipse by going to preferences and setting the proxy server your company uses.
If you don't know your proxy server and are using windows run cmd as administrator and execute this command.
netsh winhttp show proxy
If you are using another OS Google is your friend, but you need to set the proxy server in network connections of preferences dialog located in windows -> preferences of eclipse and search for proxy.
Another option is to set proxy in your home directory /.m2.settings.xml here is an exmaple
https://www.mkyong.com/maven/how-to-enable-proxy-setting-in-maven/

How to make HttpURLConnection use the PC's proxy and not via code?

My app is under development running in an emulator and I need to route traffic through Fiddler now and then to inspect and test.
How do I make the HttpURLConnection class to simply follow the PC's proxy settings instead of having to set a proxy in code?
It is easier to press F12 to turn Fiddler on/off than to add code and use a config file.
It is possible to configure a proxy in the emulator:

Why does IntelliJ want to accept incoming network connections?

➠ What feature in IntelliJ is acting as a server to accept incoming connections?
When first running IntelliJ 2017.1.1 I get a dialog box asking permission for incoming network connections.
Do you want the application “java” to accept incoming network connections?
Clicking Deny may limit the application’s behavior. This setting can be changed in the Firewall pane of Security & Privacy preferences.
[Deny] [Allow]
Example of dialog appearing on a fresh install of IntelliJ 2017.2 Ultimate edition, in the New Project wizard, when clicking on the Maven tab.
Why is IntelliJ causing this prompt? I got no such event when running NetBeans.
What exactly is the effect of denying or accepting? I am concerned about letting a Java process accept outside network connections as doing so is a serious security risk.
Possibly related to:
Question: How to bind IntelliJ IDEA random open ports to localhost only?
Issue IDEA-175889: IDE opens random ports on wildcard interface in some configurations
This Question is not about the source of the message. The source is the Apple macOS app-level firewall. You can allow or block an app from listening for incoming network connections. Allowing this is a security risk.
IntelliJ is asking to be added to the list of apps allowed to listen for incoming messages. My Question is, "Why does IntelliJ need to accept incoming network connections?".
Problably it is linked to the below.
If you click on http://localhost:63342/ you should be able to access the built-in server. Which by default should listen only on the local interface.
Open port in range 6942-6992 seems to be linked to SocketLock.java
myServer = BuiltInServer.startNioOrOio(workerCount, 6942, 50, false, handler);
note: Ports 6953, 6969, 6970 are excluded from that range. See BuiltInServer.java
private static final int[] FORBIDDEN_PORTS = {6953, 6969, 6970};
Another open port is linked to a process org.jetbrains.idea.maven.server.RemoteMavenServer
jps -l | grep jetbrains
24628 org.jetbrains.idea.maven.server.RemoteMavenServer
You could find out open port with netstat
on Linux: `netstat -ltupne`
on OSX (something like): nettop -np java
and the related java processes with jps (as show above)
as doing so is a serious security risk.
It isn't, unless you don't trust the specific product. And if you don't trust a product, why are you using it at all?
IntelliJ needs to check its license once in a while, connect to update servers, maven repositories, plugin repositories, external application servers you may want to connect to, ditto with database servers.
Netbeans needs the same, you no doubt just forgot you gave it permission at some point, or it uses an external JVM that you gave permission at some point.

System.setProperty method and proxy settings

I use proxy in my java app.I set the proxy settings from code in my java app.
System.setProperty("https.proxyHost",myproxy);
System.setProperty("https.proxyPort","80");
So I want to know that if that proxy settings affect all the other applications in the server or only that app(which I set proxy settings in it).
I don't want to affect other applications proxy settings in the server.

How do I set up Glassfish to go via a proxy server?

I have been having issues with running a Glassfish v2.1.1 instance on my local machine from within the office, where we have a proxy server for outgoing connections. My initial workaround has been to work from home.
I am calling a SOAP service on a HTTPS server outside of the company. As Glassfish is not going via the company's proxy server, I get the following error when trying to initialise my SOAP clients:
javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://www.hostname.com...
and
Caused by: java.net.UnknownHostException: www.hostname.com
I have proxy environment variables set on my command line, as well as my system proxy settings all working correctly so that I can get to the WSDL with the browser. How should I configure Glassfish?
I had a lot of trouble finding an answer to this, as the topic isn't covered in a lot of detail on the web. One link told me how to configure the HTTP proxy, but mentioned nothing about HTTPS, so it took me a while to figure it out.
Open up the admin console on your Glassfish server and go to:
Application Server -> JVM Settings -> JVM Options. Click "Add JVM Option" 4 times and enter the following 4 options
-Dhttp.proxyHost=proxyhostname
-Dhttp.proxyPort=8080
-Dhttps.proxyHost=proxyhostname
-Dhttps.proxyPort=8080
Where proxyhostname and the port number are correct for your setup. Then you need to restart the server.
Note that I couldn't find any options for setting up the proxy from a PAC file, nor for proxies which require auth. In this case, you may need to install a local auth proxy handler like Authoxy for Mac OS X, which turns your localhost into a non-auth proxy and masks the authentication request from the central auth proxy.
Also, this link was good for various proxy options to the JVM:
http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
You have to explicitly set the proxy server. Several options are available depending on the Glassfish version. In general you can set the proxy by either using JVM arguments or the Glassfish Admin console. An intro for GF3 is available here (sorry for only providing a link, but I do not want to repeat all the details here).
Just to make the answer complete, if the proxy requires user name and password, set the following in Glassfish:
-Dhttp.proxyUser=someUserName
-Dhttp.proxyPassword=somePassword
The host cannot be resolved, are you sure you use a hostname resolvable by an internet DNS server or are you using something that can only be resolved from within your network or even worse, a hosts entry local to your machine?
Aside from that, the proxy server might be denying you access to some ports, but this is probably not your problem right now. If the proxy allows access to port 80, try running your Glassfish on port 80 as well if you get any connection timeout errors.

Categories

Resources