我一直試圖使用Apache Camel的Http4組件連接到需要基本身份驗證的HTTPS URL。連接需要通過經過身份驗證的HTTP代理完成。使用基本身份驗證和代理身份驗證的駱駝Http
因此,根據docs,我配置駱駝端點這樣的:
.toD("https4://target.host/resource?
bridgeEndpoint=true
&mapHttpMessageBody=false
&proxyAuthHost=my.proxy.host
&proxyAuthPort=myProxyPort
&proxyAuthUsername=proxyUser
&proxyAuthPassword=proxyPassword
&proxyAuthScheme=http4
&authenticationPreemptive=true
&authUsername=myUser
&authPassword=myPassword")
導致來自目標服務器403 - Forbidden
響應。通過org.apache.http.wire
日誌尋找,它示出了代理證書 PROXYUSER/的proxyPassword被轉發到所述目標服務器,而不是預期的 MYUSER/的MYPASSWORD在Authorization
頭。
調試爲CompositeHTTPConfigurer.configureHttpClient
,ProxyHttpClientConfigurer.configureHttpClient
和BasicAuthenticationHttpClientConfigurer.configureHttpClient
源,似乎因爲這兩個configurers被機構將其證書的HttpClientBuilder
的setDefaultCredentialsProvider
,其中之一丟失 - 被覆蓋 - 在這個過程中。
看起來它可能是駱駝的Http4組件中的錯誤?或者我錯過了什麼?
這是Camel 2.18.2與Spring Boot 1.5.1.RELEASE。