Expand my Community achievements bar.

SOLVED

AEM 6.2 OSGi HTTP proxy with authentication drops username

Avatar

Level 2

This link for 6.2: OSGi Configuration Settings suggests org.apache.http.proxyconfigurator is available. However the java docs appear to be missing it: "The Adobe AEM Quickstart and Web Application."

Regardless, if I attempt to use org.apache.http.osgi.services.ProxyConfiguration and associated org.apache.http.osgi.services.HttpClientBuilderFactory within a vanilla 6.2 instance I see that the username, even tho it's set in the Web Console config, is ignored (an empty string is used when debugging the code).

07.02.2019 11:48:25.023 *DEBUG* [FelixStartLevel] com.xxx.aem.service.xxxServiceImpl Activating...

07.02.2019 11:48:25.024 *DEBUG* [FelixStartLevel] com.xxx.aem.service.xxxServiceImpl proxyConfiguration.isEnabled(): true

07.02.2019 11:48:25.024 *DEBUG* [FelixStartLevel] com.xxx.aem.service.xxxServiceImpl proxyConfiguration.getHostname(): localhost

07.02.2019 11:48:25.024 *DEBUG* [FelixStartLevel] com.xxx.aem.service.xxxServiceImpl proxyConfiguration.getPort(): 3128

07.02.2019 11:48:25.024 *DEBUG* [FelixStartLevel] com.xxx.aem.service.xxxServiceImpl proxyConfiguration.getUsername():

07.02.2019 11:48:25.024 *DEBUG* [FelixStartLevel] com.xxx.aem.service.xxxServiceImpl proxyConfiguration.getPassword(): proxyPa55

07.02.2019 11:48:25.024 *DEBUG* [FelixStartLevel] com.xxx.aem.service.xxxServiceImpl proxyConfiguration.getProxyExceptions(): [blah.com]

I've got a local squid proxy set up. If I use that without auth everything is fine and I see requests from AEM logged to /var/log/squid/access.log. If I setup auth on proxy server (verifing it works using a browser) then use AEM provided HTTP client it fails... must be due to the above.

I don't have this problem in 6.3. The username is logged out as expected as are requests to the proxy get through.

06.02.2019 12:03:46.896 *INFO* [0:0:0:0:0:0:0:1 [1549454626643] GET /services/xxx/touchui HTTP/1.1] com.xxx.aem.service.xxxServiceImpl ***validate proxyConfiguration.isEnabled: true

06.02.2019 12:03:46.896 *INFO* [0:0:0:0:0:0:0:1 [1549454626643] GET /services/xxx/touchui HTTP/1.1] com.xxx.aem.service.xxxServiceImpl ***validate proxyConfiguration.proxyHost: localhost

06.02.2019 12:03:46.896 *INFO* [0:0:0:0:0:0:0:1 [1549454626643] GET /services/xxx/touchui HTTP/1.1] com.xxx.aem.service.xxxServiceImpl ***validate proxyConfiguration.proxyPort: 3128

06.02.2019 12:03:46.896 *INFO* [0:0:0:0:0:0:0:1 [1549454626643] GET /services/xxx/touchui HTTP/1.1] com.xxx.aem.service.xxxServiceImpl ***validate proxyConfiguration.proxyUser: proxy_user

06.02.2019 12:03:46.896 *INFO* [0:0:0:0:0:0:0:1 [1549454626643] GET /services/xxx/touchui HTTP/1.1] com.xxx.aem.service.xxxServiceImpl ***validate proxyConfiguration.proxyPassword: proxyPa55

06.02.2019 12:03:46.896 *INFO* [0:0:0:0:0:0:0:1 [1549454626643] GET /services/xxx/touchui HTTP/1.1] com.xxx.aem.service.xxxServiceImpl ***validate proxyConfiguration.proxyExceptions: [localhost, 127.0.0.1]

I realise the Apache HTTP client in 6.2 uses version 4.3.4 whereas 6.3 uses 4.5.2. Would this have something to do with it?

1 Accepted Solution

Avatar

Correct answer by
Level 2

I can confirm that upgrading 6.2 to included SP1  (which I had already) and CFP17 (I only had CFP2 !) does indeed rectify the problem.

Thanks for your suggestion.

View solution in original post

2 Replies

Avatar

Level 10

If it doesn't retain in 6.2 vanilla instance but in 6.3, then probably that could've been a bug and fixed in SP/CFPs.

Could you try with latest SP/CFP?

Do you see the username being retained in the configuration when you open it again?

I don't think that would be with library version however, you could still update the lib version via system/console/bundles and test.

Avatar

Correct answer by
Level 2

I can confirm that upgrading 6.2 to included SP1  (which I had already) and CFP17 (I only had CFP2 !) does indeed rectify the problem.

Thanks for your suggestion.