You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Alexey Serba <as...@gmail.com> on 2013/01/10 13:52:33 UTC

http client and SSLContext.getDefault

Hi,

It seems that http client (at least 4.1.3) does not honor
SSLContext.getDefault, i.e. does not pickup SSLContext configured
using SSLContext.setDefault. The problem is that I want to override
default SSLContext at a runtime and do not have control over all
httpclient usages, i.e. can not instrument all http client instances
using "getConnectionManager().getSchemeRegistry().register(scheme)"
spell. I was thinking that httpclient should use default SSLContext by
default, but apparently it's not. I've found HTTPCLIENT-789 and it
says that the reason is that SSLContext.getDefault() is Java 6/7 only.
I'm wondering if it makes sense to use reflection here and honor
default SSLContext on Java 6/7 platforms. Any opinions?

Thanks in advance,
Alexey

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


RE: http client and SSLContext.getDefault

Posted by Mark Claassen <ma...@donnell.com>.
> My understanding is that even the latest versions of Android are still based on Java 5.
I am pretty sure it is up to Java 6 now.  In the project properties in Eclipse, you can set the Java compiler to be 1.6.  This makes
the compiler not complain about the @Override annotation on interface implementation methods.  Java 7 will not work.

Maybe it is using the Java 6 compiler but outputting a Java 5 class file?  ...I have not played around with things like this much,
so I can't really speak much to that.

I don't have much of an opinion on what the source code level of HttpClient should be.  We don't use Java 5 anymore, but it doesn't
bother me that HttpClient works with Java 5.  That being said, it seems that it should probably just stay where it is unless there
is a compelling reason to move.

Mark

-----Original Message-----
From: Alexey Serba [mailto:aserba@gmail.com] 
Sent: Friday, January 11, 2013 6:10 AM
To: httpclient-users@hc.apache.org
Subject: Re: http client and SSLContext.getDefault

It's more about changing SSLContext at a runtime. Please also see similar stackoverflow question -
http://stackoverflow.com/questions/8764845/setting-the-default-java-sslcontext-from-a-resource-at-runtime



--
View this message in context: http://httpcomponents.10934.n7.nabble.com/http-client-and-SSLContext-getDefault-tp18762p18784.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: http client and SSLContext.getDefault

Posted by Alexey Serba <as...@gmail.com>.
It's more about changing SSLContext at a runtime. Please also see similar
stackoverflow question -
http://stackoverflow.com/questions/8764845/setting-the-default-java-sslcontext-from-a-resource-at-runtime



--
View this message in context: http://httpcomponents.10934.n7.nabble.com/http-client-and-SSLContext-getDefault-tp18762p18784.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: http client and SSLContext.getDefault

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2013-01-10 at 07:55 -0500, Gary Gregory wrote:
> On Thu, Jan 10, 2013 at 7:55 AM, Gary Gregory <ga...@gmail.com>wrote:
> 
> > My preference would be to make Java 6 the minimum requirement.
> >
> 
> Start with 4.3 I should have added.
> 
> Gary
> 

Gary

My understanding is that even the latest versions of Android are still
based on Java 5. Even though Google have treated us the way they did, I
think we should try to keep HttpClient Android friendly. I simply see no
convincing reason to upgrade to Java 6. What does this exactly buy us?
If we were to bump the minimal JRE level, we should probably go to Java
7 or even 8.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Re: http client and SSLContext.getDefault

Posted by Gary Gregory <ga...@gmail.com>.
On Thu, Jan 10, 2013 at 7:55 AM, Gary Gregory <ga...@gmail.com>wrote:

> My preference would be to make Java 6 the minimum requirement.
>

Start with 4.3 I should have added.

Gary

>
> Gary
>
>
> On Thu, Jan 10, 2013 at 7:52 AM, Alexey Serba <as...@gmail.com> wrote:
>
>> Hi,
>>
>> It seems that http client (at least 4.1.3) does not honor
>> SSLContext.getDefault, i.e. does not pickup SSLContext configured
>> using SSLContext.setDefault. The problem is that I want to override
>> default SSLContext at a runtime and do not have control over all
>> httpclient usages, i.e. can not instrument all http client instances
>> using "getConnectionManager().getSchemeRegistry().register(scheme)"
>> spell. I was thinking that httpclient should use default SSLContext by
>> default, but apparently it's not. I've found HTTPCLIENT-789 and it
>> says that the reason is that SSLContext.getDefault() is Java 6/7 only.
>> I'm wondering if it makes sense to use reflection here and honor
>> default SSLContext on Java 6/7 platforms. Any opinions?
>>
>> Thanks in advance,
>> Alexey
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
>> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>>
>>
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
> Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Re: http client and SSLContext.getDefault

Posted by Gary Gregory <ga...@gmail.com>.
My preference would be to make Java 6 the minimum requirement.

Gary


On Thu, Jan 10, 2013 at 7:52 AM, Alexey Serba <as...@gmail.com> wrote:

> Hi,
>
> It seems that http client (at least 4.1.3) does not honor
> SSLContext.getDefault, i.e. does not pickup SSLContext configured
> using SSLContext.setDefault. The problem is that I want to override
> default SSLContext at a runtime and do not have control over all
> httpclient usages, i.e. can not instrument all http client instances
> using "getConnectionManager().getSchemeRegistry().register(scheme)"
> spell. I was thinking that httpclient should use default SSLContext by
> default, but apparently it's not. I've found HTTPCLIENT-789 and it
> says that the reason is that SSLContext.getDefault() is Java 6/7 only.
> I'm wondering if it makes sense to use reflection here and honor
> default SSLContext on Java 6/7 platforms. Any opinions?
>
> Thanks in advance,
> Alexey
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>


-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
JUnit in Action, 2nd Ed: <http://goog_1249600977>http://bit.ly/ECvg0
Spring Batch in Action: <http://s.apache.org/HOq>http://bit.ly/bqpbCK
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory