For my app, I need to redirect a soap request trough a local reverse proxy to an external webservice :
When I do it without the reverse proxy, it works like a charm, for example using this command :
curl -v -k --data @./test.txt --user "myuser:mypwd 'https://directurltomyexternalWS'
Response :
> POST /my/webservice/1.1
> Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXX
> User-Agent: curl/7.29.0
> Host: directurltomyexternalWS
> Accept: */*
> Content-Length: 1240
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
< X-Note: Gateway Ack
< HTTP/1.1 200 OK
< X-Backside-Transport: OK OK,OK OK
< Connection: Keep-Alive
< Transfer-Encoding: chunked
< Set-Cookie: ssnid=11a6b239683946a09c4198e6e2af9a06; path=/; secure; HttpOnly
< Content-Type: text/xml; charset=UTF-8
< Date: Fri, 17 Sep 2021 21:38:30 GMT
< X-Global-Transaction-ID: 03a4f76761450ad5291dab3d
<
<?xml version="1.0" encoding="UTF-8"?>
SOAP RETURN AS EXPECTED
But when I try to achieve the same thing while using proxypass to redirect local request to this webservice it does not work.
Apache configuration :
SSLProxyEngine On
ProxyPass /my webserviceurl
ProxyPassReverse / webserviceurl
My command :
curl -v -k --data @./test.txt --user "myuser:mypwd 'https:/hostname/my/webservice'
Return shows that it reach the webservice, but does not authenticate :
> POST /my/webservice/1.1
> Authorization: Basic XXXXXXXXXXXXXXXXXXX=
> User-Agent: curl/7.29.0
> Host: hostname:port
> Accept: */*
> Content-Length: 1240
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
< X-Note: Gateway Ack
< HTTP/1.1 401 Unauthorized
< Date: Fri, 17 Sep 2021 21:42:43 GMT
< Server: Apache
< Content-Type: text/xml; charset=UTF-8
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm=
< X-Backside-Transport: FAIL FAIL
< X-Content-Type-Options: nosniff
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
< X-permitted-cross-domain-policies: none
< Connection: close
< Transfer-Encoding: chunked
<
<env:Envelope xmlns:env=http://schemas.xmlsoap.org/soap/envelope/>
blabla
<faultstring>Authentication Failure</faultstring>
<detail>
* Closing connection 0
It seems that the header containing my basic auth data isnt going trought the proxyreverse