Skip to content

Conversation

@markendr
Copy link

Hi,

Basic authentication with a proxy server is not working with Java 1.8. This fix adds a default authenticator that uses the http.proxyUser/Password system properties for proxy authorization.

The ProxyServer.getInstance() call also seems to be redundant in HttpUtil.java, line 88, commit 4ece33c (always returns null). Not sure if it behaves differently on Java <1.8, so I have not changed it..

@johnperry
Copy link
Owner

johnperry commented Jul 21, 2021 via email

@markendr
Copy link
Author

Thanks for your reply

I have set the ProxyServer settings in config.xml (host, port, user, password) and it is working okay if auth required is off in the proxy server (squid-4 for my testing), but fails with auth required on.

The getInstance call is always returning null in HttpUtil. If I hard code the getInstance call with my proxy host, port, user, password, the code at line 90 to add the Proxy-Authorization header is called but I do not see the header on the request arriving at squid.

With the default authenticator code in my PR, the header is added under the covers somewhere. I was assuming Java 1.8 is ignoring/overriding that header, but perhaps I am doing something wrong .. ?

Thanks again, Mark

@markendr
Copy link
Author

markendr commented Aug 9, 2021

Hi,

I have now tried this on Java 1.7, and see the same problem. The current code is not adding the Proxy-Authorization header to the proxy server request. With the PR applied, proxy authentication works for both Java 1.7 and 1.8, with the Proxy-Authorization header appearing in the request to the proxy server as expected.

Our clinical sites require proxy server authentication for internet access, so it would be great if we could work out the best approach.

Is it better raising it here or on the google user group?

@johnperry
Copy link
Owner

johnperry commented Aug 9, 2021 via email

@johnperry
Copy link
Owner

johnperry commented Aug 9, 2021 via email

@johnperry
Copy link
Owner

johnperry commented Aug 9, 2021 via email

@markendr
Copy link
Author

markendr commented Aug 9, 2021

I just tried new installer thanks, but still having the same problem. I have emailed my config.xml and ctp.log to the email listed on your github page..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants