rabbitmq / rabbitmq-amqp1.0

AMQP 1.0 support for RabbitMQ
https://www.rabbitmq.com/
Other
93 stars 20 forks source link

Fail to connect to rabbitmq's AMQP 1.0 impl using a proton client #3

Closed chirino closed 11 years ago

chirino commented 11 years ago

Trying to connect to the AMQP 1.0 impl using a proton client I get the following error:

=INFO REPORT==== 13-Mar-2013::16:09:06 ===
accepting AMQP connection <0.205.0> (127.0.0.1:34679 -> 127.0.0.1:5672)

=ERROR REPORT==== 13-Mar-2013::16:09:09 ===
closing AMQP connection <0.205.0> (127.0.0.1:34679 -> 127.0.0.1:5672):
{handshake_error,starting,0,
               {'v1_0.error',{symbol,"amqp:decode-error"},
                             {utf8,<<"response <<103,117,101,115,116,0,103,117,101,115,116,0>> invalid">>},
                             undefined}}

Any idea what's going wrong?

emile commented 11 years ago

Are you using the SASL PLAIN authentication mechanism? I am not able to replicate your error using "-m PLAIN" with proton-c 0.2. The error string is "guest\0guest\0" so the problem is with authentication.

Please provide enough information to reproduce the problem if you think there is one - a command-line invocation and a version would be good.

I'd like to suggest that you use the rabbitmq-discuss mailing list to discuss interop issues instead of filing individual issues here.

emile commented 11 years ago

I get the same non-error result with qpid 0.4. The SASL init frame looks like this for me:

<frame size="54" doff="2" type="1">       
| <ulong-descriptor code="0:0x41"/> # sasl-init
| <list32 size="31" count="2">      # sasl-init
| | <sym32 size="5">                # mechanism
| | | "PLAIN"
| | </sym32>
| | <bin32 size="12">               # initial-response
| | | 00 67 75 65 73 74 00 67
| | | 75 65 73 74
| | </bin32>
| | # <null/>                          hostname
| </list32>
</frame>
chirino commented 11 years ago

I took a socket dumps of what my client is writing. It does two socket writes containing: hex: [414d515003010000] hex: [0000002302010000005341c01602a305504c41494ea00c677565737400677565737400]

Odd thing is that is my client gets much further along if it does not attempt a SASL handshake.

emile commented 11 years ago

Thanks for the detail but I find that quite hard to read. If you believe the broker is in violation can you please explain what the problem is?

chirino commented 11 years ago

if you want you can take that hex and convert it to binary and pass it to rabbitmq to recreate the error I'm seeing. Yes that 2nd write is a PLAIN sasl frame.

chirino commented 11 years ago

The same frame is decoded fine by qpidd

emile commented 11 years ago

The problem appears to be with your SASL message which includes an authorisation identity and an empty password. The implementation responsible for the error message does not accept an authorisation identity. http://hg.rabbitmq.com/rabbitmq-server/file/default/src/rabbit_auth_mechanism_plain.erl

You will have more success If you provide only an authentication identity and a password like my example: 00 67 75 65 73 74 00 67 75 65 73 74 instead of 67 75 65 73 74 00 67 75 65 73 74 00.

chirino commented 11 years ago

Ok thanks makes sense now.