You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@qpid.apache.org by "Wilson, Roger" <ro...@lehman.com> on 2009/04/28 11:40:45 UTC
SSL problems with Qpid Python client
I'm new to Qpid having been using rabbitMQ for a while.
I am running Qpid and the tests on redhat 3.4.6
While running the python client test-suite I repeatedly encounter these
errors...
======================================================================
ERROR: test_queue_query_unknown (tests_0-10.query.QueryTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/rogwilso/qpid-M4/python/qpid/testlib.py", line 364, in
setUp
self.conn = self.connect()
File "/home/rogwilso/qpid-M4/python/qpid/testlib.py", line 377, in
connect
password=testrunner.password)
File "/home/rogwilso/qpid-M4/python/qpid/connection.py", line 67, in
__init__
Assembler.__init__(self, sslwrap(sock))
File "/home/rogwilso/qpid-M4/python/qpid/connection.py", line 59, in
sslwrap
if isinstance(sock, socket.SSLType):
AttributeError: 'module' object has no attribute 'SSLType'
----------------------------------------------------------------------
Which is of course thrown everytime I try to connect.
Looking at the error and the code it is clear SSLType does not exist (I
am running python 2.6.2 (2.6.1 has the same problems) built with ssl
support on redhat).
This then raises two issues...
1. Where is SSLType and how to I get python to admit it exists?
2. Can I use the Qpid python client without SSL? The code in
connection.py would suggest not as a socket is immediately wrapped using
sslwrap...
class Connection(Assembler):
def __init__(self, sock, spec=None, delegate=client, **args):
Assembler.__init__(self, sslwrap(sock))
All suggestions welcome.
Thanks
Roger
----------------------------------------
This message is intended only for the personal and confidential use of
the designated recipient(s) named above. If you are not the intended
recipient of this message you are hereby notified that any review,
dissemination, distribution or copying of this message is strictly
prohibited. This communication is for information purposes only and
should not be regarded as an offer to sell or as a solicitation of an
offer to buy any financial product, an official confirmation of any
transaction, or as an official statement of Lehman Brothers. Email
transmission cannot be guaranteed to be secure or error-free.
Therefore, we do not represent that this information is complete or
accurate and it should not be relied upon as such. All information is
subject to change without notice.
----------------------------------------
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
RE: SSL problems with Qpid Python client
Posted by "Wilson, Roger" <ro...@lehman.com>.
Finally I managed to get this to work by commenting out the ssl socket
wrapping in connection.py...
def sslwrap(sock):
#if isinstance(sock, socket.SSLType):
# return SSLWrapper(sock)
#else:
return sock
Hopefully the client will eventually be updated to reflect the changes
to ssl made in python 2.6 but this works for me now.
-----Original Message-----
From: Wilson, Roger
Sent: 28 April 2009 14:44
To: users@qpid.apache.org
Subject: RE: SSL problems with Qpid Python client
Josh
That could well be it though I did check the occurance of SSType in 2.5
and nothing I could see was different.
I am attempting to simply disable the ssl wrapper to see if that works.
Roger
-----Original Message-----
From: Joshua Kramer [mailto:josh@globalherald.net]
Sent: 28 April 2009 15:46
To: users@qpid.apache.org
Subject: RE: SSL problems with Qpid Python client
> I'm beginning to think this is more of a python problem than anything
> to do with qpid.
This might be a 2.6 issue. From the 'whatsnew' document:
http://docs.python.org/dev/whatsnew/2.6.html
----
Improved SSL Support
Bill Janssen made extensive improvements to Python 2.6.s support for the
Secure Sockets Layer by adding a new module, ssl, that.s built atop the
OpenSSL library. This new module provides more control over the protocol
negotiated, the X.509 certificates used, and has better support for
writing SSL servers (as opposed to clients) in Python. The existing SSL
support in the socket module hasn.t been removed and continues to work,
though it will be removed in Python 3.0.
To use the new module, you must first create a TCP connection in the
usual way and then pass it to the ssl.wrap_socket() function. It.s
possible to specify whether a certificate is required, and to obtain
certificate info by calling the getpeercert() method.
----
This is good in that Python now supports proper certificate
authentication, but it will cause those of us doing Python under
OpenOffice.org to bang our heads against a wall.
--
-----
http://www.globalherald.net/jb01
GlobalHerald.NET, the Smarter Social Network! (tm)
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
----------------------------------------
This message is intended only for the personal and confidential use of
the designated recipient(s) named above. If you are not the intended
recipient of this message you are hereby notified that any review,
dissemination, distribution or copying of this message is strictly
prohibited. This communication is for information purposes only and
should not be regarded as an offer to sell or as a solicitation of an
offer to buy any financial product, an official confirmation of any
transaction, or as an official statement of Lehman Brothers. Email
transmission cannot be guaranteed to be secure or error-free.
Therefore, we do not represent that this information is complete or
accurate and it should not be relied upon as such. All information is
subject to change without notice.
----------------------------------------
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
----------------------------------------
This message is intended only for the personal and confidential use of
the designated recipient(s) named above. If you are not the intended
recipient of this message you are hereby notified that any review,
dissemination, distribution or copying of this message is strictly
prohibited. This communication is for information purposes only and
should not be regarded as an offer to sell or as a solicitation of an
offer to buy any financial product, an official confirmation of any
transaction, or as an official statement of Lehman Brothers. Email
transmission cannot be guaranteed to be secure or error-free.
Therefore, we do not represent that this information is complete or
accurate and it should not be relied upon as such. All information is
subject to change without notice.
----------------------------------------
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
Specifying Virtual Host in Python
Posted by "Wilson, Roger" <ro...@lehman.com>.
I may be completely missing something but I do not see anyway to set the
virtual host when creating a session with the qpid python client.
Neither the Connection nor the Session constructors take anything like
vhost or virtualhost argument.
The Client object does but this seems to be a special object built for a
specific purpose.
Can anyone point out what I'm so obviously missing here?
Thanks
Roger
----------------------------------------
This message is intended only for the personal and confidential use of
the designated recipient(s) named above. If you are not the intended
recipient of this message you are hereby notified that any review,
dissemination, distribution or copying of this message is strictly
prohibited. This communication is for information purposes only and
should not be regarded as an offer to sell or as a solicitation of an
offer to buy any financial product, an official confirmation of any
transaction, or as an official statement of Lehman Brothers. Email
transmission cannot be guaranteed to be secure or error-free.
Therefore, we do not represent that this information is complete or
accurate and it should not be relied upon as such. All information is
subject to change without notice.
----------------------------------------
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
RE: SSL problems with Qpid Python client
Posted by "Wilson, Roger" <ro...@lehman.com>.
Josh
That could well be it though I did check the occurance of SSType in 2.5
and nothing I could see was different.
I am attempting to simply disable the ssl wrapper to see if that works.
Roger
-----Original Message-----
From: Joshua Kramer [mailto:josh@globalherald.net]
Sent: 28 April 2009 15:46
To: users@qpid.apache.org
Subject: RE: SSL problems with Qpid Python client
> I'm beginning to think this is more of a python problem than anything
> to do with qpid.
This might be a 2.6 issue. From the 'whatsnew' document:
http://docs.python.org/dev/whatsnew/2.6.html
----
Improved SSL Support
Bill Janssen made extensive improvements to Python 2.6.s support for the
Secure Sockets Layer by adding a new module, ssl, that.s built atop the
OpenSSL library. This new module provides more control over the protocol
negotiated, the X.509 certificates used, and has better support for
writing SSL servers (as opposed to clients) in Python. The existing SSL
support in the socket module hasn.t been removed and continues to work,
though it will be removed in Python 3.0.
To use the new module, you must first create a TCP connection in the
usual way and then pass it to the ssl.wrap_socket() function. It.s
possible to specify whether a certificate is required, and to obtain
certificate info by calling the getpeercert() method.
----
This is good in that Python now supports proper certificate
authentication, but it will cause those of us doing Python under
OpenOffice.org to bang our heads against a wall.
--
-----
http://www.globalherald.net/jb01
GlobalHerald.NET, the Smarter Social Network! (tm)
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
----------------------------------------
This message is intended only for the personal and confidential use of
the designated recipient(s) named above. If you are not the intended
recipient of this message you are hereby notified that any review,
dissemination, distribution or copying of this message is strictly
prohibited. This communication is for information purposes only and
should not be regarded as an offer to sell or as a solicitation of an
offer to buy any financial product, an official confirmation of any
transaction, or as an official statement of Lehman Brothers. Email
transmission cannot be guaranteed to be secure or error-free.
Therefore, we do not represent that this information is complete or
accurate and it should not be relied upon as such. All information is
subject to change without notice.
----------------------------------------
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
RE: SSL problems with Qpid Python client
Posted by Joshua Kramer <jo...@globalherald.net>.
> I'm beginning to think this is more of a python problem than anything to
> do with qpid.
This might be a 2.6 issue. From the 'whatsnew' document:
http://docs.python.org/dev/whatsnew/2.6.html
----
Improved SSL Support
Bill Janssen made extensive improvements to Python 2.6.s support for the
Secure Sockets Layer by adding a new module, ssl, that.s built atop the
OpenSSL library. This new module provides more control over the protocol
negotiated, the X.509 certificates used, and has better support for
writing SSL servers (as opposed to clients) in Python. The existing SSL
support in the socket module hasn.t been removed and continues to work,
though it will be removed in Python 3.0.
To use the new module, you must first create a TCP connection in the usual
way and then pass it to the ssl.wrap_socket() function. It.s possible to
specify whether a certificate is required, and to obtain certificate info
by calling the getpeercert() method.
----
This is good in that Python now supports proper certificate
authentication, but it will cause those of us doing Python under
OpenOffice.org to bang our heads against a wall.
--
-----
http://www.globalherald.net/jb01
GlobalHerald.NET, the Smarter Social Network! (tm)
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
RE: SSL problems with Qpid Python client
Posted by "Wilson, Roger" <ro...@lehman.com>.
Josh
Thanks for the reply.
I'm using Qpid-M4 python client library and Python 2.6.1 on redhat
3.4.6.
I'm beginning to think this is more of a python problem than anything to
do with qpid.
This works...
from socket import ssl
This does not...
from socket import SSLType
The problem is even though I'm not planning on using ssl I can't bring
up a connection because __init__ of the Connection class calls sslwrap
which is defined in terms of socket.SSLType which cannot be found and
throws an attribute error. So you can choose not to use ssl but only if
you have ssl.
Roger
-----Original Message-----
From: Joshua Kramer [mailto:josh@globalherald.net]
Sent: 28 April 2009 15:23
To: users@qpid.apache.org
Subject: Re: SSL problems with Qpid Python client
Hello Roger,
> 2. Can I use the Qpid python client without SSL? The code in
> connection.py would suggest not as a socket is immediately wrapped
> using sslwrap...
The sslwrap method actually determines if you've wrapped the socket in
SSL. If you have not, it just returns the normal Socket object that you
pass in. You can indeed use Python without SSL, if that's what you want
to do.
What version of the code are you using?
Cheers,
-Josh
--
-----
http://www.globalherald.net/jb01
GlobalHerald.NET, the Smarter Social Network! (tm)
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
----------------------------------------
This message is intended only for the personal and confidential use of
the designated recipient(s) named above. If you are not the intended
recipient of this message you are hereby notified that any review,
dissemination, distribution or copying of this message is strictly
prohibited. This communication is for information purposes only and
should not be regarded as an offer to sell or as a solicitation of an
offer to buy any financial product, an official confirmation of any
transaction, or as an official statement of Lehman Brothers. Email
transmission cannot be guaranteed to be secure or error-free.
Therefore, we do not represent that this information is complete or
accurate and it should not be relied upon as such. All information is
subject to change without notice.
----------------------------------------
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org
Re: SSL problems with Qpid Python client
Posted by Joshua Kramer <jo...@globalherald.net>.
Hello Roger,
> 2. Can I use the Qpid python client without SSL? The code in
> connection.py would suggest not as a socket is immediately wrapped using
> sslwrap...
The sslwrap method actually determines if you've wrapped the socket in
SSL. If you have not, it just returns the normal Socket object that you
pass in. You can indeed use Python without SSL, if that's what you want
to do.
What version of the code are you using?
Cheers,
-Josh
--
-----
http://www.globalherald.net/jb01
GlobalHerald.NET, the Smarter Social Network! (tm)
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:users-subscribe@qpid.apache.org