| Please give us a way to configure corporate proxy via Geoserver GUI. I can't use simple `-Dhttp.proxyHost=http://proxy.memorynotfound.com -Dhttp.proxyPort=80` Tomcat configuration because I realy need to pass a password. I need this in the code: // settings proxy credentials System.setProperty("http.proxyUser", "proxyUser"); System.setProperty("http.proxyPassword", "secret"); // Java ignores http.proxyUser. Here come's the workaround. Authenticator.setDefault(new Authenticator() { @Override protected PasswordAuthentication getPasswordAuthentication() { if (getRequestorType() == RequestorType.PROXY) { String prot = getRequestingProtocol().toLowerCase(); String host = System.getProperty(prot + ".proxyHost", ""); String port = System.getProperty(prot + ".proxyPort", "80"); String user = System.getProperty(prot + ".proxyUser", ""); String password = System.getProperty(prot + ".proxyPassword", ""); if (getRequestingHost().equalsIgnoreCase(host)) { if (Integer.parseInt(port) == getRequestingPort()) { return new PasswordAuthentication(user, password.toCharArray()); } } } return null; } }); |