url = urllib.urlencode({'ssl_options': {'ca_certs': '/path/ca.crt', 'certfile': '/path/client.crt', 'keyfile': '/path/client.key'}})
connection = pika.BlockingConnection(pika.connection.URLParameters('amqp://user:password@localhost:5673/myvhost?' + url))
$ tail /var/log/rabbitmq/rab...@localhost.log
=INFO REPORT==== 11-Jul-2013::20:28:58 ===
accepting AMQP connection <0.2486.0> ([::1]:46746 -> [::1]:5673)
=ERROR REPORT==== 11-Jul-2013::20:28:58 ===
SSL: hello: ./ssl_record.erl:366:Fatal error: record overflow
=ERROR REPORT==== 11-Jul-2013::20:29:03 ===
error on AMQP connection <0.2486.0>: {ssl_upgrade_error,"record overflow"} (unknown POSIX error)
$ openssl s_client -connect localhost:5673 -cert /path/client.crt -key /path/client.key -CAfile /path/ca.crt
CONNECTED(00000003)
Verify return code: 0 (ok)
---
--
You received this message because you are subscribed to the Google Groups "Pika" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pika-python...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
shouldn't you be using 'amqps' instead of 'amqp' in your uri?
-ml
On Thu, Jul 11, 2013 at 8:54 PM, <jbus...@gmail.com> wrote:
Hello list,I'm attempting to get Pika to connect to RabbitMQ via SSL.To aid in troubleshooting, I configured RabbitMQ as a tcp_listener on port 5672, and as a ssl_listener on port 5673.The connection snippet below works fine when port 5672 is in the URLParameters, (I assume the ssl_options are ignored), however, I get pika.exceptions.ConnectionClosed exceptions and errors in RabbitMQ logs when attempting the same on port 5673.Python connection snippet:url = urllib.urlencode({'ssl_options': {'ca_certs': '/path/ca.crt', 'certfile': '/path/client.crt', 'keyfile': '/path/client.key'}})
connection = pika.BlockingConnection(pika.connection.URLParameters('amqp://user:password@localhost:5673/myvhost?' + url))Logs:
$ tail /var/log/rabbitmq/rabbit@localhost.log
=INFO REPORT==== 11-Jul-2013::20:28:58 ===
accepting AMQP connection <0.2486.0> ([::1]:46746 -> [::1]:5673)
=ERROR REPORT==== 11-Jul-2013::20:28:58 ===
SSL: hello: ./ssl_record.erl:366:Fatal error: record overflow
=ERROR REPORT==== 11-Jul-2013::20:29:03 ===
error on AMQP connection <0.2486.0>: {ssl_upgrade_error,"record overflow"} (unknown POSIX error)
Hello list,I'm attempting to get Pika to connect to RabbitMQ via SSL.To aid in troubleshooting, I configured RabbitMQ as a tcp_listener on port 5672, and as a ssl_listener on port 5673.The connection snippet below works fine when port 5672 is in the URLParameters, (I assume the ssl_options are ignored), however, I get pika.exceptions.ConnectionClosed exceptions and errors in RabbitMQ logs when attempting the same on port 5673.Python connection snippet:url = urllib.urlencode({'ssl_options': {'ca_certs': '/path/ca.crt', 'certfile': '/path/client.crt', 'keyfile': '/path/client.key'}})
connection = pika.BlockingConnection(pika.connection.URLParameters('amqp://user:password@localhost:5673/myvhost?' + url))Logs:
$ tail /var/log/rabbitmq/rabbit@localhost.log
=INFO REPORT==== 11-Jul-2013::20:28:58 ===
accepting AMQP connection <0.2486.0> ([::1]:46746 -> [::1]:5673)
=ERROR REPORT==== 11-Jul-2013::20:28:58 ===
SSL: hello: ./ssl_record.erl:366:Fatal error: record overflow
=ERROR REPORT==== 11-Jul-2013::20:29:03 ===
error on AMQP connection <0.2486.0>: {ssl_upgrade_error,"record overflow"} (unknown POSIX error)