You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Keith Wall (JIRA)" <ji...@apache.org> on 2016/04/03 00:22:25 UTC

[jira] [Comment Edited] (QPID-7180) Test harness qpid-python-test cannot authenticate to Broker when using swigged client (0-10/1.0)

    [ https://issues.apache.org/jira/browse/QPID-7180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15223063#comment-15223063 ] 

Keith Wall edited comment on QPID-7180 at 4/2/16 10:22 PM:
-----------------------------------------------------------

The issue relates to the formation of the url.   The pure python messaging API (qpid.util.URL) expects the URL to be formed like this:

{noformat}
[   <scheme>://  ] [    <user>   [   / <password>   ] @]    ( <host4>     | \[    <host6>    \] )  [   :<port>   ]
{noformat}

whereas the C++ messaging client expects:

{noformat}
url = ["amqp:"][ user ["/" password] "@" ] protocol_addr *("," protocol_addr)
{noformat}

When using the swigged client, the test harness passes the Broker url from the command line (-b)  through to the native qpid_messaging Connection#establish.  Connection interprets the double slash that follows the scheme as an empty username, so as all the sasl mechanism require username/password, gives up.

The test harness does not make provision to pass connection options to the Connection so I see no way to override the usernane/password, as things stand.  It is also not possible to pass a C++ messaging style URL, as the test harness always parses the broker url with the qpid.util.URL, even if the swigged client is in use.






was (Author: k-wall):
The issue relates to the formation of the url.   The pure python messaging API (qpid.util.URL) expects the URL to be formed like this:

{noformat}
[   <scheme>://  ] [    <user>   [   / <password>   ] @]    ( <host4>     | \[    <host6>    \] )  [   :<port>   ]
{noformat}

whereas the C++ messaging client expects:

{noformat}
url = ["amqp:"][ user ["/" password] "@" ] protocol_addr *("," protocol_addr)
{noformat}

When using the swigged client, the test harness passes the Broker url from the command line (-b)  through to the native qpid_messaging Connection#establish.  Connection interprets the double slash that follows the scheme as an empty username, so as all the sasl mechanism require username/password, gives up.  The test harness does not make provision to pass connection options to the Connection so I see no way to override the usernane/password, as things stand.




> Test harness qpid-python-test cannot authenticate to Broker when using swigged client (0-10/1.0)
> ------------------------------------------------------------------------------------------------
>
>                 Key: QPID-7180
>                 URL: https://issues.apache.org/jira/browse/QPID-7180
>             Project: Qpid
>          Issue Type: Bug
>          Components: Python Test Suite
>            Reporter: Keith Wall
>
> I am running the Python test suite (the 0-10 tests) with a Java Broker that is configured to require authentication.  If I use the pure python messaging implementation, the tests are able to authenticate and pass.  If I switch to use the swigged client, the tests fail to authenticate.  The same issue occurs running the 1.0 test suite.
> I am running the test suite like so:
> {code}
> qpid-python-test -b amqp://guest/guest@localhost:36398
> {code}
> The error when using the swigged client with tracing turned on looks like this:
> {noformat}
> 2016-04-02 15:27:10 [Messaging] debug Protocol defaults: 
> qpid_tests.broker_1_0.general.GeneralTests.test_anonymous_relay .........2016-04-02 15:27:11 [Messaging] debug Trying versions amqp1.0
> 2016-04-02 15:27:11 [Messaging] debug Driver started
> 2016-04-02 15:27:11 [Messaging] info Starting connection to amqp://guest/guest@tcp:localhost:36398
> 2016-04-02 15:27:11 [Messaging] info Connecting to tcp:localhost:36398
> 2016-04-02 15:27:11 [Messaging] debug tcp:localhost:36398 Connecting ...
> 2016-04-02 15:27:11 [Client] debug Set TCP_NODELAY
> 2016-04-02 15:27:11 [System] info Connecting: 127.0.0.1:36398
> 2016-04-02 15:27:11 [Messaging] debug tcp:localhost:36398 Connected
> 2016-04-02 15:27:11 [Messaging] debug wakeupDriver()
> 2016-04-02 15:27:11 [Messaging] debug tcp:localhost:36398 Waiting to be authenticated...
> 2016-04-02 15:27:11 [Security] trace tcp:localhost:36398 Sasl::canEncode(): 1 || 0
> 2016-04-02 15:27:11 [Security] trace tcp:localhost:36398 Sasl::canEncode(): 1 || 0
> 2016-04-02 15:27:11 [Protocol] debug tcp:localhost:36398 writing protocol header: 1-0
> 2016-04-02 15:27:11 [Security] trace tcp:localhost:36398 Sasl::encode(65535): 8
> 2016-04-02 15:27:11 [Security] trace tcp:localhost:36398 Sasl::canEncode(): 0 || 0
> 2016-04-02 15:27:11 [Protocol] debug tcp:localhost:36398 read protocol header: 1-0
> 2016-04-02 15:27:11 [Security] trace Reading SASL frame of size 59
> 2016-04-02 15:27:11 [Security] trace Reading SASL-MECHANISMS
> 2016-04-02 15:27:11 [Protocol] debug tcp:localhost:36398 Received SASL-MECHANISMS(PLAIN CRAM-MD5 SCRAM-SHA-1 SCRAM-SHA-256 )
> 2016-04-02 15:27:11 [Security] debug CyrusSasl::start(PLAIN CRAM-MD5 SCRAM-SHA-1 SCRAM-SHA-256 )
> 2016-04-02 15:27:11 [Security] debug min_ssf: 0, max_ssf: 256
> 2016-04-02 15:27:11 [System] debug Exception constructed: Can't authenticate using PLAIN CRAM-MD5 SCRAM-SHA-1 SCRAM-SHA-256 
> 2016-04-02 15:27:11 [Client] info tcp:localhost:36398 Failure during authentication: Can't authenticate using PLAIN CRAM-MD5 SCRAM-SHA-1 SCRAM-SHA-256 
> 2016-04-02 15:27:11 [Security] trace tcp:localhost:36398 Sasl::decode(67): 67
> 2016-04-02 15:27:11 [Messaging] debug [127.0.0.1:58639-localhost:36398] TcpTransport closing...
> 2016-04-02 15:27:11 [Messaging] debug [127.0.0.1:58639-localhost:36398] Socket closed
>  fail
> Error during setup:  Traceback (most recent call last):
>     File "/home/jenkins/jenkins-slave/workspace/Qpid-Python-Java-Test/site-packages/bin/qpid-python-test", line 340, in run
>       phase()
>     File "/home/jenkins/jenkins-slave/workspace/Qpid-Python-Java-Test/site-packages/lib/python2.7/site-packages/qpid/tests/messaging/__init__.py", line 44, in setup
>       self.conn = self.setup_connection()
>     File "/home/jenkins/jenkins-slave/workspace/Qpid-Python-Java-Test/site-packages/lib/python2.7/site-packages/qpid/tests/messaging/__init__.py", line 199, in setup_connection
>       return self.create_connection()
>     File "/home/jenkins/jenkins-slave/workspace/Qpid-Python-Java-Test/site-packages/lib/python2.7/site-packages/qpid/tests/messaging/__init__.py", line 196, in create_connection
>       return Connection.establish(self.broker, **opts)
>     File "/home/jenkins/jenkins-slave/workspace/Qpid-Python-Java-Test/trunk/qpid/cpp/build/ship/lib/python2.7/site-packages/qpid_messaging.py", line 648, in establish
>       conn.open()
>     File "/home/jenkins/jenkins-slave/workspace/Qpid-Python-Java-Test/trunk/qpid/cpp/build/ship/lib/python2.7/site-packages/qpid_messaging.py", line 604, in open
>       def open(self): return _qpid_messaging.Connection_open(self)
>   ConnectionError: Can't authenticate using PLAIN CRAM-MD5 SCRAM-SHA-1 SCRAM-SHA-256
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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