You are viewing a plain text version of this content. The canonical link for it is here.
Posted to proton@qpid.apache.org by Rajith Attapattu <ra...@gmail.com> on 2012/08/14 20:40:10 UTC
SSL support
Rafi,
>From what I understand there are two ways to use SSL/TLS with AMQP 1.0
a) A secure connection is established right off the bat.
b) A regular tcp connection is established and then based on the AMQP
header (with a protocol id of 2) you start encrypting the packets that
follow.
The first option seems fairly straightforward. For the second,
1. Once we get the AMQP header indicating we need to use TLS, should
we expect the SASL header to follow ?
2. If we have TLS connection, is SASL authentication optional ?
Additionally can the peers chose to use SASL encryption? If so how do
we figure that out?
I didn't find that information under "Book 5 : Security section "
Regards,
Rajith
Re: SSL support
Posted by Andrew Stitcher <as...@redhat.com>.
On Tue, 2012-08-14 at 16:51 -0400, Rafael Schloming wrote:
> > I'm not sure we have a pressing need to support this mechanism. A
> > pattern that would potentially be more interesting is to run TLS and
> > non-TLS connections on the same port.
> >
>
> I believe the C++ broker supports this. Andrew can probably comment in more
> detail, but I believe it's all kind of similar. Basically you examine the
> first few bytes of the connection and depending on whether it looks like an
> ordinary AMQP header, an AMQP-over-TLS header, or the magic cruft at the
> beginning of a TLS connection you just dispatch appropriately in each case.
The C++ broker does support this functionality. The implementation is a
little crude at the moment, but I'm thinking about how to improve it
such that it would be the basic mechanism going forward. That is to say
switch early between Plain AMQP-1.0, AMQP-1.0-over-TLS, TLS, AMQP-0-10.
In principle you initially only need to read the first few bytes (5 for
TLS, I think 8 for AMQP) then if the connection was encrypted do it
again to distinguish the protocol version (whilst excluding
possibilities like TLS over TLS, and AMQP-1.0-over-TLS over TLS).
Ideally I want to do away with having to configure this layer of the
broker with ports specific to the protocol, just have the broker
auto-detect anything it speaks on any ports it's connected to.
> From what I understand, the tricky part is to do the initial
> reading/buffering in such a manner that you don't end up reading more than
> you should and buffering stuff you were supposed to dispatch to something
> else, e.g. the SSL engine.
This is certainly one of the significant implementation details.
Andrew
Re: SSL support
Posted by Rafael Schloming <rh...@alum.mit.edu>.
On Tue, Aug 14, 2012 at 4:36 PM, Rob Godfrey <ro...@gmail.com>wrote:
> On 14 August 2012 20:40, Rajith Attapattu <ra...@gmail.com> wrote:
> > Rafi,
> >
> > From what I understand there are two ways to use SSL/TLS with AMQP 1.0
> >
> > a) A secure connection is established right off the bat.
> >
> > b) A regular tcp connection is established and then based on the AMQP
> > header (with a protocol id of 2) you start encrypting the packets that
> > follow.
>
> I'm not sure we have a pressing need to support this mechanism. A
> pattern that would potentially be more interesting is to run TLS and
> non-TLS connections on the same port.
>
I believe the C++ broker supports this. Andrew can probably comment in more
detail, but I believe it's all kind of similar. Basically you examine the
first few bytes of the connection and depending on whether it looks like an
ordinary AMQP header, an AMQP-over-TLS header, or the magic cruft at the
beginning of a TLS connection you just dispatch appropriately in each case.
>From what I understand, the tricky part is to do the initial
reading/buffering in such a manner that you don't end up reading more than
you should and buffering stuff you were supposed to dispatch to something
else, e.g. the SSL engine.
>
> >
> > The first option seems fairly straightforward. For the second,
> >
> > 1. Once we get the AMQP header indicating we need to use TLS, should
> > we expect the SASL header to follow ?
> > 2. If we have TLS connection, is SASL authentication optional ?
> >
>
> Yes, theoretically a peer may be configured such that the
> authentication offered by TLS is sufficient and therefore no SASL
> exchange is required.
>
> > Additionally can the peers chose to use SASL encryption? If so how do
> > we figure that out?
> > I didn't find that information under "Book 5 : Security section "
>
> Do the relevant SASL mechanisms not make clear when the encryption of
> the session begins? I don;t believe there is anything special we need
> to do to "figure out" when SASL encryption is being used is there?
>
I think given the current set of use cases in mind for proton I'd venture a
guess that SASL based encryption mechanisms can probably take a back burner
relative to SSL/TLS based encryption, but please shout if you feel
otherwise.
--Rafael
Re: SSL support
Posted by Rob Godfrey <ro...@gmail.com>.
On 14 August 2012 20:40, Rajith Attapattu <ra...@gmail.com> wrote:
> Rafi,
>
> From what I understand there are two ways to use SSL/TLS with AMQP 1.0
>
> a) A secure connection is established right off the bat.
>
> b) A regular tcp connection is established and then based on the AMQP
> header (with a protocol id of 2) you start encrypting the packets that
> follow.
I'm not sure we have a pressing need to support this mechanism. A
pattern that would potentially be more interesting is to run TLS and
non-TLS connections on the same port.
>
> The first option seems fairly straightforward. For the second,
>
> 1. Once we get the AMQP header indicating we need to use TLS, should
> we expect the SASL header to follow ?
> 2. If we have TLS connection, is SASL authentication optional ?
>
Yes, theoretically a peer may be configured such that the
authentication offered by TLS is sufficient and therefore no SASL
exchange is required.
> Additionally can the peers chose to use SASL encryption? If so how do
> we figure that out?
> I didn't find that information under "Book 5 : Security section "
Do the relevant SASL mechanisms not make clear when the encryption of
the session begins? I don;t believe there is anything special we need
to do to "figure out" when SASL encryption is being used is there?
-- Rob
>
> Regards,
>
> Rajith