Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4DB6D1192A for ; Thu, 24 Jul 2014 16:47:40 +0000 (UTC) Received: (qmail 12774 invoked by uid 500); 24 Jul 2014 16:47:39 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 12704 invoked by uid 500); 24 Jul 2014 16:47:39 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 12693 invoked by uid 99); 24 Jul 2014 16:47:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jul 2014 16:47:39 +0000 X-ASF-Spam-Status: No, hits=0.7 required=5.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [64.85.173.253] (HELO server.dankulp.com) (64.85.173.253) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Jul 2014 16:47:37 +0000 Received: by server.dankulp.com (Postfix, from userid 5000) id 58759185FD1; Thu, 24 Jul 2014 12:47:11 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on server.dankulp.com X-Spam-Level: X-Msg-File: /tmp/mailfilter-users@cxf.apache.org.9oDutJufeC Received: from macbook.dankulp.com (c-50-176-22-10.hsd1.ma.comcast.net [50.176.22.10]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.dankulp.com (Postfix) with ESMTPSA id 4535E1803A0; Thu, 24 Jul 2014 12:47:07 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Using CXF with Https Proxy From: Daniel Kulp In-Reply-To: Date: Thu, 24 Jul 2014 12:45:21 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: References: <34B3258B-4F94-4F30-A943-A2A606B47CD4@oliver-becherer.name> To: users@cxf.apache.org, Oliver Becherer X-Mailer: Apple Mail (2.1878.6) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.7 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 I think the HOST header might be set down deep in the URLConnection call = someplace. Not really sure. Here=92s my suggestion: =20 Create an instance of = org.apache.cxf.transport.https.HttpsURLConnectionFactory and call the = createConnection method in it passing in a Proxy object and = TLSClientParameters (if needed) and the URL. Use that = HttpURLConnection to try and do a post of a sample message to the = server. If you can get that to work via request properties or similar, = then we may be able to get things updated to match whatever you get = working. =20 Dan On Jul 24, 2014, at 10:37 AM, Oliver Becherer = wrote: > hi, >=20 > i assume this scenario is quite unusal (regarding answers), so i tried = to find a valid workaround and currently i'm trying it like this :=20 >=20 > Client client =3D ClientProxy.getClient(MYWEBSERVICEPORT); > client.getRequestContext().put(Message.ENDPOINT_ADDRESS, = "https://some-weird-https-proxy.com") ; >=20 >=20 > this is working fine so far, but to tell the proxy where he has to = deliver the message to, i'd had to > modify http protocol header, especially the Host variable. >=20 > -> unfortunately it seems, as if the Host Variable in http header is = overwritten somewhere deeeeep into the Interceptor Chain or at least in = Transport layer > -> my custom interceptor is setting Host Variable, but within outgoing = Request, its again overwritten from framework >=20 >=20 > Could somebody please direct me , how i can avoid, that cxf is = automatically setting http header Host variable? >=20 > thanks a lot! >=20 > kind regards >=20 > O > =09 >=20 > Am 23.07.2014 um 21:57 schrieb Oliver Becherer = : >=20 >> hi all, >>=20 >> i'm just stuck with a problem using cxf :=20 >>=20 >> i implemented a soap client to a webservice using cxf 2.6.1 and its = working fine... now i have the challenge of sending one single service = operation >> to the usual endpoint but over a proxy server that only accepts = https. >>=20 >> so these are the base facts :=20 >>=20 >> Service Endpoint : https://some-usual-soap-endpoint.com >>=20 >> Proxy Server : https://some-weird-https-proxy.com >> Proxy Port : 7777 >>=20 >> This is my approach :=20 >>=20 >> HTTPClientPolicy policy =3D new HTTPClientPolicy(); >> policy.setProxyServer("some-weird-https-proxy.com"); >> policy.setProxyServerPort(7777); >> =09 >> Client client =3D ClientProxy.getClient(awspt); >> HTTPConduit http =3D (HTTPConduit) client.getConduit(); >> http.setClient(policy); >>=20 >>=20 >> so far so good, but the requests are reaching the proxy not using = https, but http and the proxy is not accepting this. >>=20 >> can you help me, how to configure the Proxy Server within my Client, = so Request is sent using https? >>=20 >> any help is highly appreciated! >>=20 >> kind regards >>=20 >> O >=20 --=20 Daniel Kulp dkulp@apache.org - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com