[Geoserver-devel] [JIRA] (GEOS-9313) Configuation of Proxy via GUI

Carlos Magno Abreu created an issue

GeoServer / New FeatureGEOS-9313

Configuation of Proxy via GUI

Issue Type:

New FeatureNew Feature

Assignee:

Unassigned

Components:

Configuration

Created:

29/Aug/19 4:31 PM

Priority:

MediumMedium

Reporter:

Carlos Magno Abreu

Please give us a way to configure corporate proxy via Geoserver GUI. I can’t use simple -Dhttp.proxyHost=[http://proxy.memorynotfound.com](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;
}
});

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100108-sha1:62188b6)

Atlassian logo