I'm trying to access a ArcGISMapImageLayer(http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer) over a webproxy, which requires a basic authentication with username and password.
I figured out 2 possibilities, but neither the configuration over the java.net.ProxySelector properties like http.proxyHost/http.proxyPort nor the RequestConfiguration.setProxyInfo("webproxy.sbb.ch", 8080, "http") worked as I expected.
I implemented my own AuthenticationChallengeHandler and registered it over the static method
AuthenticationManager.setAuthenticationChallengeHandler(..)
, which is never invoked.
When I set
RequestConfiguration.setProxyInfo("webproxy.sbb.ch", 8080, "https")
then the AuthenticationChallengeHandler is invoked, but instead of the expected USER_CREDENTIAL_CHALLENGE
a SELF_SIGNED_CHALLENGE AuthenticationChallenge is delivered.
The following SSLException had been occured :
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:710)
at sun.security.ssl.InputRecord.read(InputRecord.java:527)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
at com.esri.arcgisruntime.internal.httpclient.conn.b.e.a(SourceFile:394)
at com.esri.arcgisruntime.internal.httpclient.conn.b.e.a(SourceFile:353)
at com.esri.arcgisruntime.internal.httpclient.impl.c.e.a(SourceFile:141)
So obviously arcgis establishes a SSL connection to the proxy. Does the AuthenticationChallengeHandler only works with SSL connections or is it a bug?