Return-Path: X-Original-To: apmail-jclouds-user-archive@minotaur.apache.org Delivered-To: apmail-jclouds-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 50371178B1 for ; Fri, 3 Oct 2014 18:02:44 +0000 (UTC) Received: (qmail 69707 invoked by uid 500); 3 Oct 2014 18:02:44 -0000 Delivered-To: apmail-jclouds-user-archive@jclouds.apache.org Received: (qmail 69644 invoked by uid 500); 3 Oct 2014 18:02:44 -0000 Mailing-List: contact user-help@jclouds.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@jclouds.apache.org Delivered-To: mailing list user@jclouds.apache.org Received: (qmail 69634 invoked by uid 99); 3 Oct 2014 18:02:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Oct 2014 18:02:44 +0000 X-ASF-Spam-Status: No, hits=1.0 required=5.0 tests=FORGED_YAHOO_RCVD,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of yurykats@yahoo.com designates 98.139.213.141 as permitted sender) Received: from [98.139.213.141] (HELO nm23-vm1.bullet.mail.bf1.yahoo.com) (98.139.213.141) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Oct 2014 18:02:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1412359335; bh=JC2xgCfaLn+zN/9e3bZ/74TMll/wmomKq+XZiVGBQ68=; h=Received:Received:Received:DKIM-Signature:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:From:Subject; b=swjsbWnW5PzNkvXf7lKFHTa0FXpHpykMaQGS7eHZf0Xk3kBugGdXvK1VFki5Vo6lsVYr7hKNX8bajg4Wkl+Rb1xP7m2jtu8fLCGXH4G/R2ZlPfC0TKPrjDsrMTG1psUzar355+087OIgndgQ11woh8bWdPYaXuaYTjJ0whGHY39vaCe5vQM0+5Q6LVhUx7lpPxiqPnirgpxwYjZFRgOvZrVFC5t0+yjMn5BKGfF4dHAp0Fmq0FaF+WwU/esRvU8cpSQhIqEDYPGPnw3aeHHisbu1Bncw2/RSGwLgHOMX8tOAMcMEuPma7pCUxBIunxw2S1kjSCHwjKJag+j3SoUvQg== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=pZ4zVuDxTPog/4ZFeRyrgorHAfhTNvnB3Jwdkd6cSTvSWrxpPKK6d6dOe6SJx6ckk1tunTYcbXxmKWHV9FX9f0hBrLoZbQv/1WNc5IZfbwJFfoom82yy5TyZHC2DXd0ahajDLR+cqsuPWpq35noA/SjMan2nQS7RFPHnzG2MiD8rpddhlW3oT+LVUij3aDuU+So6c1c74969m1nRF0QOXMe0jO+qd2+cNEt/z96YGEBok6jj47ELX6teCeuXT9wMjjtfKwfUDHJk18K3lLsCowdV1VY/eHBliHYtQWxIXnx9F8BNgtCrWRF1LZNJJdVDonOQ0xXxJUzGk/jREGs61g==; Received: from [98.139.215.141] by nm23.bullet.mail.bf1.yahoo.com with NNFMP; 03 Oct 2014 18:02:15 -0000 Received: from [68.142.230.65] by tm12.bullet.mail.bf1.yahoo.com with NNFMP; 03 Oct 2014 18:02:15 -0000 Received: from [127.0.0.1] by smtp222.mail.bf1.yahoo.com with NNFMP; 03 Oct 2014 18:02:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1412359335; bh=JC2xgCfaLn+zN/9e3bZ/74TMll/wmomKq+XZiVGBQ68=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=qvwBe+NDCm4lmt5B9MD02oRiPPNTa5B3hTemDhNmsibv0OL0zFE/QOUjYoh2A92sG9+dnCCtB8vgMIas962OQaDyc/DHW9BpvfOOB1m6hMTM3EGjE2pQlsMNr5I89hMmSp/wFAlIAOSSAx8vD8x5Jnbf9kZWbmvDHWLV8rMp2zI= X-Yahoo-Newman-Id: 382567.87566.bm@smtp222.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 7vm7vZEVM1mYoT9ApTT.WTLwII8bUuzVUl60_rifRWY6Lw. Dz70ry_mz2TvBRs5xzWDvZzBPd4wdzBWWwghJBaDQoVvuwAywCGXJ_ZghmsZ qnV4291NeBr63mCytnjlt0v3INUwyZWqzMyjVi9ccr25_a8jBAiFb98m50Vi LTtywjBRJCHxMUGpyKHKYwF1tl.OFTiJpLoOS0jC2Z_DYZYcQcqdLSJvBMh9 dYchvaIQMbNhwyZD9UhT6CUq2hIKTgUnI7d_hokiJAr9KlzR.a.ec5Ch9onZ Nh7Cj2d9RtIyll6SGIxJd.Cz1cuLx.o8EpSfMwdn9pOmp96JIdVO9ngxQYky 7wc5aKNi60cEVjJsbHX8O7E1O4605IGWDSfPbdwOe_NWJeUPJ4ZXhMS3lLYM VleFlm._QoIjdAmwOdww9S9FkjAeU3QmblJFrdCE1GPqklZ56Fo6eEj4Tfso ksmkqS1WUEAA.9zB6rVpy9bB20gkHla350_LV0QwnmCKyPglk_Tn2AYiup.C GjEiycIijo42uh15xVcephArtMoO5drgNGpJrcqCtAaZr5MuldLvsl.s_ML7 skxEt3OFpVVOshr1aWHU1cusuM.ajA61oO8Cx9ucLkKdwCUA15zdS_azMMgO 8.qrNskgELaj6IUxK_6KL1FGu6YFQsR8ZNCRVHpLk4Co8Zw5zF2nCzIHA83I wuR1hWCNTsdF0OM5I41bCyJE91CMdaydAGwY1VyTya10UjBYHJEAi_Acr7zT SNs.yQcs.f28e5LNWkgcNGrb0aZo069FyY0BaFoc- X-Yahoo-SMTP: Xc0D9PSswBCzl7QEioTGF6RJytwf Message-ID: <542EE4A5.4020603@yahoo.com> Date: Fri, 03 Oct 2014 14:02:13 -0400 From: Yury Kats User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Thunderbird/1.0.6 Mnenhy/0.7.1 MIME-Version: 1.0 To: user@jclouds.apache.org Subject: Re: Self-signed certs References: <542DCDB7.9020304@yahoo.com> <20141003082651.pueu3kief4scs4c4@webmail.qrmedia.com> <542EA1C9.4030502@yahoo.com> <20141003155645.ti3n0vlh5w08480c@webmail.qrmedia.com> <542ECB7D.6080009@yahoo.com> <542ED753.9040607@yahoo.com> In-Reply-To: Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Awesome, this worked! Thank you! And please ignore my previous comment about non-default drivers not being used. It was a user error -- I put into wrong code path, so it wasn't exercised. But providing my own SSL context is even better. So there is definitely something's wrong with the default http driver as far as ssl/connection handling. Something's cached forever. Aside from this SSL issue, are there any other reasons for me to look at okhttp or apachehc drivers? Thanks again! On 10/3/2014 1:22 PM, Adrian Cole wrote: > That sounds very strange indeed. I don't have an answer for how to > verify which driver is in use, except maybe put a breakpoint. > > PS I had a quick look at the code [1]. It seems we are wired to > optionally accept Supplier if the user binds one. This > would also be used with OkHttp according to the current impl. > > In other words, you can try this to manage your own ssl context on a > per-request basis. If you have luck doing this, then maybe we can > arrange a test case that replicates the scenario you discuss. > > .modules(ImmutableSet.of(new AbstractModule(){ > @Override public void configure() { > bind(new TypeLiteral>(){}).toInstance(new > Supplier() { > @Override public SSLContext get() { > return whatYouManage; // note this is called per-request so > can be expensive. > } > } > } > })) > > [1] https://github.com/jclouds/jclouds/blob/master/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java#L207 > > On Fri, Oct 3, 2014 at 10:05 AM, Yury Kats wrote: >> Tried both, no change in behavior. >> >> However, what's confusing, is that if I add just the jclouds-okhttp jar, without pulling its dependencies (no okhttp and okio), >> I can still instantiate the KeystoneApi and connect >> >> KeystoneApi keystoneAPI = ContextBuilder.newBuilder(new KeystoneApiMetadata()) >> .endpoint(url) >> .credentials(tenant + ":" + user, key) >> .modules(ImmutableSet.of(new OkHttpCommandExecutorServiceModule())) >> .buildApi(KeystoneApi.class); >> >> Which makes me think the driver is not being utilized, regardless of the .modules() modifier. >> >> How can I confirm what driver is actually being used to make the connection? >> >> >> On 10/3/2014 12:44 PM, Adrian Cole wrote: >>> Nope that's it. Same process for the okhttp one (if you wish to try it) >>> >>> -A >>> >>> On Oct 3, 2014 9:15 AM, "Yury Kats" > wrote: >>> >>> Thanks, got them. >>> >>> So to use those drivers, all I need to do is add >>> >>> .modules(ImmutableSet.of(new ApacheHCHttpCommandExecutorServiceModule())) >>> >>> into >>> >>> KeystoneApi keystoneAPI = ContextBuilder.newBuilder(new KeystoneApiMetadata()) >>> .endpoint(url) >>> .credentials(tenant + ":" + user, key) >>> .buildApi(KeystoneApi.class); >>> >>> Or is there more to it? >>> >>> On 10/3/2014 9:56 AM, Andrew Phillips wrote: >>> > Hi Yury >>> > >>> >> I don't seem to find those in any of the jclouds 1.8.0 jars. >>> >> Where do I get them from? >>> > >>> > They're additional dependencies with GA >>> > org.apache.jclouds.driver:jclouds-okhttp and >>> > org.apache.jclouds.driver:jclouds-apachehc [1] respectively. You >>> > should be able to add them to your project as just an additional Maven >>> > dependency (if you're using Maven) - they'll take care of wiring them >>> > up themselves. >>> > >>> > If you have any questions or it doesn't seem to work, please give us >>> > some more details about your project setup (e.g. are you using Maven?). >>> > >>> > Regards >>> > >>> > ap >>> > >>> > [1] http://search.maven.org/#search%7Cga%7C1%7Cjclouds%20driver >>> > >>> >> >