使用鼠兔的rabbitmq连接

时间:2016-09-21 00:45:18

标签: python python-2.7 ssl rabbitmq

我使用SSL配置RabbitMQ服务器,我使用Python 2.7.8与pika连接到它没有问题。我将服务器配置为获取客户端证书,并且必须验证才能连接。

但是当我在另一个项目中切换到Python 2.7.11并使用完全相同的代码和相同的客户端证书以及相同的鼠标版本时,RabbitMQ服务器正在关闭连接。

Python异常:

 File "..\lib\site-packages\pika\adapters\blocking_connection.py", line 339, in __init__
    self._process_io_for_connection_setup()
  File "..\lib\site-packages\pika\adapters\blocking_connection.py", line 374, in _process_io_for_connection_setup
    self._open_error_result.is_ready)
  File "..\lib\site-packages\pika\adapters\blocking_connection.py", line 395, in _flush_output
    raise exceptions.ConnectionClosed()
pika.exceptions.ConnectionClosed

RabbitMQ服务器日志:

error on AMQP connection <0.966.0>: {ssl_upgrade_failure,
                                     {{function_clause,
                                       [{tls_v1,enum_to_oid,
                                         [28],
                                         [{file,"tls_v1.erl"},{line,404}]},
                                        {ssl_handshake,
                                         '-dec_hello_extensions/2-blc$^1/1-0-',
                                         1,
                                         [{file,"ssl_handshake.erl"},
                                          {line,1653}]},
                                        {ssl_handshake,
                                         '-dec_hello_extensions/2-blc$^1/1-0-',
                                         1,
                                         [{file,"ssl_handshake.erl"},
                                          {line,1653}]},
                                        {ssl_handshake,dec_hello_extensions,
                                         2,
                                         [{file,"ssl_handshake.erl"},
                                          {line,1653}]},
                                        {tls_handshake,decode_handshake,3,
                                         [{file,"tls_handshake.erl"},
                                          {line,182}]},
                                        {tls_handshake,get_tls_handshake_aux,
                                         3,
                                         [{file,"tls_handshake.erl"},
                                          {line,153}]},
                                        {tls_connection,next_state,4,
                                         [{file,"tls_connection.erl"},
                                          {line,454}]},
                                        {gen_fsm,handle_msg,7,
                                         [{file,"gen_fsm.erl"},{line,505}]}]},
                                      {gen_fsm,sync_send_all_state_event,
                                       [<0.967.0>,{start,5000},infinity]}}} (unknown POSIX error)

RabbitMQ服务器的域名是“rabbit.test.com”。服务器证书和客户端证书的CN与域名完全相同。

知道为什么它适用于Python 2.7.8但不适用于Python 2.7.11?

0 个答案:

没有答案