2016-08-22 10 views
0

同じコードはUbuntuで動作し、Centosでは動作しません!ファイアウォールはすでに閉じているPikaはubuntuでRabbitMqに接続できますが、Centosでは動作しませんか?

Ubuntu 16.04、python version 3.5.2。

Centos 7、pythonバージョン3.5.2。

Ubuntuとcentosは新しくvirtualboxにインストールされました! RabbitMq config tls!

CentOSの場合、接続するとrabbitmqは無効になりますが、接続するとrabbitmq enable sslが失敗します。

私を助けることができますか?どうもありがとう!

これのRabbitMQ設定:

rabbit, [ 
     { loopback_users, [ ] }, 
     { tcp_listeners, [ 5672 ] }, 
     { ssl_listeners, [ 5671 ] }, 
     { ssl_options, [ 
       { cacertfile, "/ca/private/ca.crt" }, 
       { certfile, "/ca/server/server.pem" }, 
       { fail_if_no_peer_cert, false }, 
       { keyfile, "/ca/server/server.key" }, 
       { verify, verify_peer } 
     ] }, 
     { hipe_compile, false } 
] 

このコード:

#!/usr/bin/env python3.5 
import pika 
import ssl 

ssl_options = {  
    "ca_certs":"/root/ca/private/ca.crt", 
    "certfile": "/root/ca/rbq/client.crt", 
    "keyfile": "/root/ca/rbq/client.key", 
    "cert_reqs": ssl.CERT_REQUIRED, 
    "ssl_version":ssl.PROTOCOL_TLSv1_2 
} 
credentials = pika.PlainCredentials('ttttt', '123456') 
parameters = pika.ConnectionParameters(host='192.168.1.164', 
             port=5671, 
             virtual_host='/', 
             heartbeat_interval = 0, 
             credentials=credentials, 
             ssl = True, 
             ssl_options = ssl_options) 
connection = pika.BlockingConnection(parameters) 
connection.close() 

このエラーメッセージ:

Traceback (most recent call last): 
    File "./rb.py", line 20, in <module> 
    connection = pika.BlockingConnection(parameters) 
    File "/usr/local/lib/python3.5/site-packages/pika/adapters/blocking_connection.py", line 339, in __init__ 
    self._process_io_for_connection_setup() 
    File "/usr/local/lib/python3.5/site-packages/pika/adapters/blocking_connection.py", line 374, in _process_io_for_connection_setup 
    self._open_error_result.is_ready) 
    File "/usr/local/lib/python3.5/site-packages/pika/adapters/blocking_connection.py", line 395, in _flush_output 
    raise exceptions.ConnectionClosed() 
pika.exceptions.ConnectionClosed 

このRabbitMQのサーバーログ:

[[email protected] rabbitmq]# tail [email protected] 
SSL: certify: ssl_alert.erl:93:Fatal error: decrypt error 

=INFO REPORT==== 22-Aug-2016::12:50:48 === 
accepting AMQP connection <0.22118.20> (192.168.1.131:48526 -> 192.168.1.164:5671) 

=INFO REPORT==== 22-Aug-2016::12:50:48 === 
closing AMQP connection <0.22118.20> (192.168.1.131:48526 -> 192.168.1.164:5671) 

=ERROR REPORT==== 22-Aug-2016::12:54:04 === 
SSL: certify: ssl_alert.erl:93:Fatal error: decrypt error 
+0

本当に、ポートは開いていて、接続を停止する可能性のあるファイアウォールルールはありませんか? – piyushj

+0

ファイアウォールは既に閉じています! – Yangyang

+0

これを見てくださいhttps://github.com/pika/pika/issues/650 – piyushj

答えて

0

私のサーバ証明書は、署名アルゴリズム私はSHA256にアルゴリズムを更新

redhat document about openssl

としてmd5WithRSAEncryptionを使用しています。私はOKを動作させる! :)

ありがとう!

関連する問題