You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by MattiasÖ <ma...@wirelesscar.com> on 2015/01/29 16:52:21 UTC

qpid-amqp-1-0-client-jms and TLS 1.2

Hi!

I have searched the archives for information on the following issue but have
not found any. Please point me in the right direction if there is any :)

I'm trying to achieve a connection towards a broker that only accepts AMQP
1.0 over a TLS 1.2 connection.
In order to do this, I'm using the qpid-amqp-1-0-client-jms lib. However as
far as I can see, this does not seem doable.

I would like to know if this:
a) Is doable by some configuration of the lib that I haven't found?
b) Is a feature that is in the pipe to do, or can it be requested?
c) Is something that I could/should code a patch for and send in for a
review?

Here are my technical findings on the issue:

1) I'm creating a Connection via
org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl
2) ConnectionFactoryImpl uses org.apache.qpid.amqp_1_0.client.SSLUtil to
create a SSLContext using provided truststore, keystore etc..
3) SSLUtil initiates a SSLContext with a hardcoded String:
TRANSPORT_LAYER_SECURITY_CODE = "TLS"
4) In Oracle JDK 7, the file "<jdk installation
path>\jre\lib\security\java.security" register
com.sun.net.ssl.internal.ssl.Provider, an extension of
sun.security.ssl.SunJSSE, as the default JSSE provider. This class is, in
turn, configures that sun.security.ssl.SSLContextImpl$TLS10Context should be
used as SSLContext for the alias "TLS".
5) TLS10Context is only registering TLSv1 and SSLv3 as the default protocols
to use.
6) This means that when org.apache.qpid.amqp_1_0.client.TCPTransportProvier
(which btw lacks a "d" in the name) is creating the underlying connection
between the qpid client and the broker, the SSLSocket only gets enabled with
"TLSv1" and "SSLv3".

I've tried to change TRANSPORT_LAYER_SECURITY_CODE to "TLSv1.2" and
recompile the qpid-amqp-1-0-client-jms lib and use this recompiled version
instead. This was working successfully and gave me a connection that can
connect to a broker configured with any of the following protocols ["SSLv3",
"TLSv1", "TLSv1.1", "TLSv1.2"].
My next test is to once again use "TLS" in SSLUtil, but instead provide
ConnectionFactoryImpl with a list of protocols that I want to be enabled.
These will then be sent downwards through the stack to the
TCPTransportProvier that can apply these directly to the SSLSocket per
connection.

All in all, can anyone involved tell me which of a, b or c above, is correct
or should be done?

Best regards,
Mattias



--
View this message in context: http://qpid.2158936.n2.nabble.com/qpid-amqp-1-0-client-jms-and-TLS-1-2-tp7619126.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: qpid-amqp-1-0-client-jms and TLS 1.2

Posted by Rob Godfrey <ro...@gmail.com>.
Hi Mattias,

On 16 February 2015 at 16:07, MattiasÖ <ma...@wirelesscar.com>
wrote:

> Hi!
>
> I have now done some testing for my use case and it seems to work all fine
> to enable/disable different protocols and also to initialize the SSLContext
> with different protocol names.
>

Glad to hear it works :-)



> I hope you still manage to get it into the next release, even though my
> late
> answer with test results.
>
>
Yep - the release branch hasn't yet been cut (sometime later this week I
think), so anything currently on trunk will make it into 0.32.


> Do you want me to report back into this thread or into the corresponding
> JIRA issue if I find any bugs regarding this later on?
>

Feel free to just report anything here in the mailing list.


>
> Thanks again Rob!
>
>
No problem,

-- Rob

Re: qpid-amqp-1-0-client-jms and TLS 1.2

Posted by MattiasÖ <ma...@wirelesscar.com>.
Hi!

I have now done some testing for my use case and it seems to work all fine
to enable/disable different protocols and also to initialize the SSLContext
with different protocol names.
I hope you still manage to get it into the next release, even though my late
answer with test results.

Do you want me to report back into this thread or into the corresponding
JIRA issue if I find any bugs regarding this later on?

Thanks again Rob!



--
View this message in context: http://qpid.2158936.n2.nabble.com/qpid-amqp-1-0-client-jms-and-TLS-1-2-tp7619126p7620304.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: qpid-amqp-1-0-client-jms and TLS 1.2

Posted by Rob Godfrey <ro...@gmail.com>.
Great - thanks Mattais... let me know if there are any issues and then I
can make sure things are fixed for 0.32

Cheers,
Rob

On 6 February 2015 at 10:48, MattiasÖ <ma...@wirelesscar.com>
wrote:

> Hi Rob!
>
> Sorry for the late answer, but I've been away.
>
> At a first glance the changes looks excellent and I think they will cover
> my
> use case.
> I will try a build out and should be able to provide you with an
> answer/result early next week!
>
> Regards,
> Mattias
>
>
>
> --
> View this message in context:
> http://qpid.2158936.n2.nabble.com/qpid-amqp-1-0-client-jms-and-TLS-1-2-tp7619126p7619688.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: qpid-amqp-1-0-client-jms and TLS 1.2

Posted by MattiasÖ <ma...@wirelesscar.com>.
Hi Rob!

Sorry for the late answer, but I've been away.

At a first glance the changes looks excellent and I think they will cover my
use case.
I will try a build out and should be able to provide you with an
answer/result early next week!

Regards,
Mattias



--
View this message in context: http://qpid.2158936.n2.nabble.com/qpid-amqp-1-0-client-jms-and-TLS-1-2-tp7619126p7619688.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: qpid-amqp-1-0-client-jms and TLS 1.2

Posted by Rob Godfrey <ro...@gmail.com>.
OK - I've made a few more changes... I've renamed the options I added
previously to and added the ability to set the enabled protocols on the
socked.  You can use the system property "qpid.ssl.enabledProtocols", or
the url option ssl-enabled-protocols (or set the property
sslEnabledProtocols on the ConnectionFactory) to provide a comma separated
list of the protocols you want enabled.  There is an analogous "disabled"
version for removing protocols you don't want enabled (which defaults to
SSLv3).

Does this provide everything you need?

-- Rob

On 30 January 2015 at 14:48, MattiasÖ <ma...@wirelesscar.com>
wrote:

> Hi Rob!
>
> Thanks for the very quick response!
>
> My setup is JDK 7u45.
> I have bundled Qpid and Apache Camel (camel-core, camel-spring, camel-amqp,
> acticemq-camel, qpid-amqp-1-0-client-jms) and deploy this on Jboss.
> This means that I configure everything via a spring xml, so I can't really
> check enabled protocols except via trial and error against my test AMQP
> broker (activemq 5.9).
>
> Examples of setup ("Client" refers to my value of the
> TRANSPORT_LAYER_SECURITY_CODE String in SSLUtil):
>
> Client        Broker                                   Success     Used
> Protocol
> -------       --------                                   ---------
> ---------------
> "TLS"        "TLSv1","TLSv1.1", "TLSv1.2"     yes           "TLSv1"
> "TLS"        "TLSv1.1", "TLSv1.2"                 no
> handshake_failure
> "TLS"        "TLSv1.2"                                no
> handshake_failure
> "TLSv1.2"  "TLSv1","TLSv1.1", "TLSv1.2"     yes           "TLSv1.2"
> "TLSv1.2"  "TLSv1", "TLSv1.1"                   yes           "TLSv1.1"
> "TLSv1.2"  "TLSv1"                                  yes           "TLSv1"
>
> From these results and via checking source code and some documentation (see
> links below), my understanding is that the Protocol parameter you pass to
> SSLContext.getInstance( ... ), is a reference to a context that have some
> set of supported protocols and another (sub)set of (default) enabled
> protocols.
> The Context initialized with "TLS" only have "TLSv1" enabled per default,
> but it does support all the other versions of TLS _if_ they are actively
> enabled via for example SSLSockets setEnabledProtocols(String[] protocols)
> method.
> The Context initialized with "TLSv1.2" on the other hand, have the same set
> of supported protocols, but sets "TLSv1", "TLSv1.1" and "TLSv1.2" to
> enabled
> per default.
>
> In my use case, I want to set my client to only be able to connect with
> "TLSv1.2" because of security reasons. I shouldn't be able to successfully
> connect to a broker with more relaxed configuration (support of "TLSv1.1"
> or
> lower).
> As I see it, there are probably only one way to achieve this:
> * SSLContext is initialized with either "TLS" or "TLSv1" or "TLSv1.1" or
> "TLSv1.2" (they have the same set of supported protocols)
> * TCPTransportProvier creates the SSLSocket using the above SSLContext.
> * TCPTransportProvier performs sslSocket.setEnabledProtocols("TLSv1.2").
>
> This way the socket "should" only connect with "TLSv1.2" I think.
>
> If setEnabledProtocols() is not used, I believe you get the behaviour that
> I
> seem to get from my tests, where the client would accept all the protocols
> enabled per default (different sets depending on the initializating
> string).
>
> As for why you get the same set of enabled protocols from initializing with
> both "TLS" and with "TLSv1.2", I have no clue. That does seem a bit
> strange,
> since I don't seem to get the same behaviour.
> Maybe you're using another provider than SunJSSE where "TLS" is mapped
> against "TLSv1.2" instead?
>
> Of course I may also have understood everything above completely wrong. As
> you said, the documentation is really wonderfully vague :)
>
> Your changes so far seems really good though and should give the user a
> much
> more dynamic way of configuring SSL/TLS. However I don't think they would
> cover my use case completely.
> What are your thoughts on this?
>
> Finally here are some of the references that I've found:
> *
>
> http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.html#SunJSSEProvider
> *
>
> https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https
> * Some background info in the description:
> https://bugs.openjdk.java.net/browse/JDK-7093640
> * The mappings of the SSLContext initialization String towards an actual
> class:
>
> http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/70e3553d9d6e/src/share/classes/sun/security/ssl/SunJSSE.java
> * The actual implementations of each SSLContext:
>
> http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/70e3553d9d6e/src/share/classes/sun/security/ssl/SSLContextImpl.java
>
> Best Regards
> Mattias
>
>
>
> --
> View this message in context:
> http://qpid.2158936.n2.nabble.com/qpid-amqp-1-0-client-jms-and-TLS-1-2-tp7619126p7619221.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>

Re: qpid-amqp-1-0-client-jms and TLS 1.2

Posted by MattiasÖ <ma...@wirelesscar.com>.
Hi Rob!

Thanks for the very quick response!

My setup is JDK 7u45.
I have bundled Qpid and Apache Camel (camel-core, camel-spring, camel-amqp,
acticemq-camel, qpid-amqp-1-0-client-jms) and deploy this on Jboss.
This means that I configure everything via a spring xml, so I can't really
check enabled protocols except via trial and error against my test AMQP
broker (activemq 5.9).

Examples of setup ("Client" refers to my value of the
TRANSPORT_LAYER_SECURITY_CODE String in SSLUtil):

Client        Broker                                   Success     Used
Protocol
-------       --------                                   ---------    
---------------
"TLS"        "TLSv1","TLSv1.1", "TLSv1.2"     yes           "TLSv1"
"TLS"        "TLSv1.1", "TLSv1.2"                 no           
handshake_failure
"TLS"        "TLSv1.2"                                no           
handshake_failure
"TLSv1.2"  "TLSv1","TLSv1.1", "TLSv1.2"     yes           "TLSv1.2"
"TLSv1.2"  "TLSv1", "TLSv1.1"                   yes           "TLSv1.1"
"TLSv1.2"  "TLSv1"                                  yes           "TLSv1"

>From these results and via checking source code and some documentation (see
links below), my understanding is that the Protocol parameter you pass to
SSLContext.getInstance( ... ), is a reference to a context that have some
set of supported protocols and another (sub)set of (default) enabled
protocols.
The Context initialized with "TLS" only have "TLSv1" enabled per default,
but it does support all the other versions of TLS _if_ they are actively
enabled via for example SSLSockets setEnabledProtocols(String[] protocols)
method.
The Context initialized with "TLSv1.2" on the other hand, have the same set
of supported protocols, but sets "TLSv1", "TLSv1.1" and "TLSv1.2" to enabled
per default.

In my use case, I want to set my client to only be able to connect with
"TLSv1.2" because of security reasons. I shouldn't be able to successfully
connect to a broker with more relaxed configuration (support of "TLSv1.1" or
lower).
As I see it, there are probably only one way to achieve this:
* SSLContext is initialized with either "TLS" or "TLSv1" or "TLSv1.1" or
"TLSv1.2" (they have the same set of supported protocols)
* TCPTransportProvier creates the SSLSocket using the above SSLContext.
* TCPTransportProvier performs sslSocket.setEnabledProtocols("TLSv1.2").

This way the socket "should" only connect with "TLSv1.2" I think.

If setEnabledProtocols() is not used, I believe you get the behaviour that I
seem to get from my tests, where the client would accept all the protocols
enabled per default (different sets depending on the initializating string).

As for why you get the same set of enabled protocols from initializing with
both "TLS" and with "TLSv1.2", I have no clue. That does seem a bit strange,
since I don't seem to get the same behaviour.
Maybe you're using another provider than SunJSSE where "TLS" is mapped
against "TLSv1.2" instead?

Of course I may also have understood everything above completely wrong. As
you said, the documentation is really wonderfully vague :)

Your changes so far seems really good though and should give the user a much
more dynamic way of configuring SSL/TLS. However I don't think they would
cover my use case completely. 
What are your thoughts on this?

Finally here are some of the references that I've found:
*
http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.html#SunJSSEProvider
*
https://blogs.oracle.com/java-platform-group/entry/diagnosing_tls_ssl_and_https
* Some background info in the description:
https://bugs.openjdk.java.net/browse/JDK-7093640
* The mappings of the SSLContext initialization String towards an actual
class:
http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/70e3553d9d6e/src/share/classes/sun/security/ssl/SunJSSE.java
* The actual implementations of each SSLContext:
http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/file/70e3553d9d6e/src/share/classes/sun/security/ssl/SSLContextImpl.java

Best Regards
Mattias



--
View this message in context: http://qpid.2158936.n2.nabble.com/qpid-amqp-1-0-client-jms-and-TLS-1-2-tp7619126p7619221.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

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


Re: qpid-amqp-1-0-client-jms and TLS 1.2

Posted by Rob Godfrey <ro...@gmail.com>.
I've committed a change which should allow you to set the SSL protocol (and
SSL provider) either as a System Property, or - if you are using the
Connection Factory, using a URL option (see
https://issues.apache.org/jira/browse/QPID-6349)

-- Rob

On 29 January 2015 at 21:25, Rob Godfrey <ro...@gmail.com> wrote:

> Hi (again) Mattias,
>
> Out of interest, which JDK version and platform are you seeing this on.
> Testing with 7u75 on my Mac I see both getInstance("TLS") and
> getInstance("TLSv1.2") return the same set of enabled protocols:
>  ["SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"]
>
> The Oracle documentation is wonderfully vague on what you can expect:
>  (from
> http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#SSLContext
> )
>
> TLS : Supports some version of TLS; may support other versions
> TLSv1.2 : Supports RFC 5246: TLS version 1.2
> <http://www.ietf.org/rfc/rfc5246.txt> ; may support other versions
>
> My inclination is to leave the default as "TLS" but the user to set both
> the protocol and the provider as system properties, e.g. in your case you
> could do
>
> System.setProperty("qpid.ssl.protocol", "TLSv1.2");
>
> (or obviously set via -D on the command line).
>
> Would that work for you as a solution?
>
> -- Rob
>
> On 29 January 2015 at 20:26, Rob Godfrey <ro...@gmail.com> wrote:
>
>> Hi Mattias,
>>
>> apologies for this, I'll make a fix along the lines you suggested and
>> apply it to trunk this evening.  Thank you for spending the time to
>> investigate the issue and suggest the solution - much appreciated!
>>
>> -- Rob
>>
>> On 29 January 2015 at 16:52, MattiasÖ <ma...@wirelesscar.com>
>> wrote:
>>
>>> Hi!
>>>
>>> I have searched the archives for information on the following issue but
>>> have
>>> not found any. Please point me in the right direction if there is any :)
>>>
>>> I'm trying to achieve a connection towards a broker that only accepts
>>> AMQP
>>> 1.0 over a TLS 1.2 connection.
>>> In order to do this, I'm using the qpid-amqp-1-0-client-jms lib. However
>>> as
>>> far as I can see, this does not seem doable.
>>>
>>> I would like to know if this:
>>> a) Is doable by some configuration of the lib that I haven't found?
>>> b) Is a feature that is in the pipe to do, or can it be requested?
>>> c) Is something that I could/should code a patch for and send in for a
>>> review?
>>>
>>> Here are my technical findings on the issue:
>>>
>>> 1) I'm creating a Connection via
>>> org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl
>>> 2) ConnectionFactoryImpl uses org.apache.qpid.amqp_1_0.client.SSLUtil to
>>> create a SSLContext using provided truststore, keystore etc..
>>> 3) SSLUtil initiates a SSLContext with a hardcoded String:
>>> TRANSPORT_LAYER_SECURITY_CODE = "TLS"
>>> 4) In Oracle JDK 7, the file "<jdk installation
>>> path>\jre\lib\security\java.security" register
>>> com.sun.net.ssl.internal.ssl.Provider, an extension of
>>> sun.security.ssl.SunJSSE, as the default JSSE provider. This class is, in
>>> turn, configures that sun.security.ssl.SSLContextImpl$TLS10Context
>>> should be
>>> used as SSLContext for the alias "TLS".
>>> 5) TLS10Context is only registering TLSv1 and SSLv3 as the default
>>> protocols
>>> to use.
>>> 6) This means that when
>>> org.apache.qpid.amqp_1_0.client.TCPTransportProvier
>>> (which btw lacks a "d" in the name) is creating the underlying connection
>>> between the qpid client and the broker, the SSLSocket only gets enabled
>>> with
>>> "TLSv1" and "SSLv3".
>>>
>>> I've tried to change TRANSPORT_LAYER_SECURITY_CODE to "TLSv1.2" and
>>> recompile the qpid-amqp-1-0-client-jms lib and use this recompiled
>>> version
>>> instead. This was working successfully and gave me a connection that can
>>> connect to a broker configured with any of the following protocols
>>> ["SSLv3",
>>> "TLSv1", "TLSv1.1", "TLSv1.2"].
>>> My next test is to once again use "TLS" in SSLUtil, but instead provide
>>> ConnectionFactoryImpl with a list of protocols that I want to be enabled.
>>> These will then be sent downwards through the stack to the
>>> TCPTransportProvier that can apply these directly to the SSLSocket per
>>> connection.
>>>
>>> All in all, can anyone involved tell me which of a, b or c above, is
>>> correct
>>> or should be done?
>>>
>>> Best regards,
>>> Mattias
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://qpid.2158936.n2.nabble.com/qpid-amqp-1-0-client-jms-and-TLS-1-2-tp7619126.html
>>> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
>>> For additional commands, e-mail: users-help@qpid.apache.org
>>>
>>>
>>
>

Re: qpid-amqp-1-0-client-jms and TLS 1.2

Posted by Rob Godfrey <ro...@gmail.com>.
Hi (again) Mattias,

Out of interest, which JDK version and platform are you seeing this on.
Testing with 7u75 on my Mac I see both getInstance("TLS") and
getInstance("TLSv1.2") return the same set of enabled protocols:
["SSLv3", "TLSv1",
"TLSv1.1", "TLSv1.2"]

The Oracle documentation is wonderfully vague on what you can expect:
 (from
http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#SSLContext
)

TLS : Supports some version of TLS; may support other versions
TLSv1.2 : Supports RFC 5246: TLS version 1.2
<http://www.ietf.org/rfc/rfc5246.txt> ; may support other versions

My inclination is to leave the default as "TLS" but the user to set both
the protocol and the provider as system properties, e.g. in your case you
could do

System.setProperty("qpid.ssl.protocol", "TLSv1.2");

(or obviously set via -D on the command line).

Would that work for you as a solution?

-- Rob

On 29 January 2015 at 20:26, Rob Godfrey <ro...@gmail.com> wrote:

> Hi Mattias,
>
> apologies for this, I'll make a fix along the lines you suggested and
> apply it to trunk this evening.  Thank you for spending the time to
> investigate the issue and suggest the solution - much appreciated!
>
> -- Rob
>
> On 29 January 2015 at 16:52, MattiasÖ <ma...@wirelesscar.com>
> wrote:
>
>> Hi!
>>
>> I have searched the archives for information on the following issue but
>> have
>> not found any. Please point me in the right direction if there is any :)
>>
>> I'm trying to achieve a connection towards a broker that only accepts AMQP
>> 1.0 over a TLS 1.2 connection.
>> In order to do this, I'm using the qpid-amqp-1-0-client-jms lib. However
>> as
>> far as I can see, this does not seem doable.
>>
>> I would like to know if this:
>> a) Is doable by some configuration of the lib that I haven't found?
>> b) Is a feature that is in the pipe to do, or can it be requested?
>> c) Is something that I could/should code a patch for and send in for a
>> review?
>>
>> Here are my technical findings on the issue:
>>
>> 1) I'm creating a Connection via
>> org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl
>> 2) ConnectionFactoryImpl uses org.apache.qpid.amqp_1_0.client.SSLUtil to
>> create a SSLContext using provided truststore, keystore etc..
>> 3) SSLUtil initiates a SSLContext with a hardcoded String:
>> TRANSPORT_LAYER_SECURITY_CODE = "TLS"
>> 4) In Oracle JDK 7, the file "<jdk installation
>> path>\jre\lib\security\java.security" register
>> com.sun.net.ssl.internal.ssl.Provider, an extension of
>> sun.security.ssl.SunJSSE, as the default JSSE provider. This class is, in
>> turn, configures that sun.security.ssl.SSLContextImpl$TLS10Context should
>> be
>> used as SSLContext for the alias "TLS".
>> 5) TLS10Context is only registering TLSv1 and SSLv3 as the default
>> protocols
>> to use.
>> 6) This means that when
>> org.apache.qpid.amqp_1_0.client.TCPTransportProvier
>> (which btw lacks a "d" in the name) is creating the underlying connection
>> between the qpid client and the broker, the SSLSocket only gets enabled
>> with
>> "TLSv1" and "SSLv3".
>>
>> I've tried to change TRANSPORT_LAYER_SECURITY_CODE to "TLSv1.2" and
>> recompile the qpid-amqp-1-0-client-jms lib and use this recompiled version
>> instead. This was working successfully and gave me a connection that can
>> connect to a broker configured with any of the following protocols
>> ["SSLv3",
>> "TLSv1", "TLSv1.1", "TLSv1.2"].
>> My next test is to once again use "TLS" in SSLUtil, but instead provide
>> ConnectionFactoryImpl with a list of protocols that I want to be enabled.
>> These will then be sent downwards through the stack to the
>> TCPTransportProvier that can apply these directly to the SSLSocket per
>> connection.
>>
>> All in all, can anyone involved tell me which of a, b or c above, is
>> correct
>> or should be done?
>>
>> Best regards,
>> Mattias
>>
>>
>>
>> --
>> View this message in context:
>> http://qpid.2158936.n2.nabble.com/qpid-amqp-1-0-client-jms-and-TLS-1-2-tp7619126.html
>> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
>> For additional commands, e-mail: users-help@qpid.apache.org
>>
>>
>

Re: qpid-amqp-1-0-client-jms and TLS 1.2

Posted by Rob Godfrey <ro...@gmail.com>.
Hi Mattias,

apologies for this, I'll make a fix along the lines you suggested and apply
it to trunk this evening.  Thank you for spending the time to investigate
the issue and suggest the solution - much appreciated!

-- Rob

On 29 January 2015 at 16:52, MattiasÖ <ma...@wirelesscar.com>
wrote:

> Hi!
>
> I have searched the archives for information on the following issue but
> have
> not found any. Please point me in the right direction if there is any :)
>
> I'm trying to achieve a connection towards a broker that only accepts AMQP
> 1.0 over a TLS 1.2 connection.
> In order to do this, I'm using the qpid-amqp-1-0-client-jms lib. However as
> far as I can see, this does not seem doable.
>
> I would like to know if this:
> a) Is doable by some configuration of the lib that I haven't found?
> b) Is a feature that is in the pipe to do, or can it be requested?
> c) Is something that I could/should code a patch for and send in for a
> review?
>
> Here are my technical findings on the issue:
>
> 1) I'm creating a Connection via
> org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl
> 2) ConnectionFactoryImpl uses org.apache.qpid.amqp_1_0.client.SSLUtil to
> create a SSLContext using provided truststore, keystore etc..
> 3) SSLUtil initiates a SSLContext with a hardcoded String:
> TRANSPORT_LAYER_SECURITY_CODE = "TLS"
> 4) In Oracle JDK 7, the file "<jdk installation
> path>\jre\lib\security\java.security" register
> com.sun.net.ssl.internal.ssl.Provider, an extension of
> sun.security.ssl.SunJSSE, as the default JSSE provider. This class is, in
> turn, configures that sun.security.ssl.SSLContextImpl$TLS10Context should
> be
> used as SSLContext for the alias "TLS".
> 5) TLS10Context is only registering TLSv1 and SSLv3 as the default
> protocols
> to use.
> 6) This means that when org.apache.qpid.amqp_1_0.client.TCPTransportProvier
> (which btw lacks a "d" in the name) is creating the underlying connection
> between the qpid client and the broker, the SSLSocket only gets enabled
> with
> "TLSv1" and "SSLv3".
>
> I've tried to change TRANSPORT_LAYER_SECURITY_CODE to "TLSv1.2" and
> recompile the qpid-amqp-1-0-client-jms lib and use this recompiled version
> instead. This was working successfully and gave me a connection that can
> connect to a broker configured with any of the following protocols
> ["SSLv3",
> "TLSv1", "TLSv1.1", "TLSv1.2"].
> My next test is to once again use "TLS" in SSLUtil, but instead provide
> ConnectionFactoryImpl with a list of protocols that I want to be enabled.
> These will then be sent downwards through the stack to the
> TCPTransportProvier that can apply these directly to the SSLSocket per
> connection.
>
> All in all, can anyone involved tell me which of a, b or c above, is
> correct
> or should be done?
>
> Best regards,
> Mattias
>
>
>
> --
> View this message in context:
> http://qpid.2158936.n2.nabble.com/qpid-amqp-1-0-client-jms-and-TLS-1-2-tp7619126.html
> Sent from the Apache Qpid users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org
> For additional commands, e-mail: users-help@qpid.apache.org
>
>