need help in connection reset by peer

142 views
Skip to first unread message

james jasper

unread,
Dec 29, 2022, 12:28:26 AM12/29/22
to rabbitmq-users
consumer.py(clinet)
---------------------------------------------------------------------------------------------------------------------------- 
import pika, sys, os,ssl

def main():

    context =ssl.create_default_context()
    context.verify_mode = ssl.CERT_REQUIRED
    context.load_verify_locations(cafile="/home/dev/Desktop/rab/ca_certificate.pem")
    context.load_cert_chain(certfile="/home/dev/Desktop/rab/client_certificate.pem",keyfile="/home/dev/Desktop/rab/private_key.pem")
    credentials = pika.PlainCredentials(username='***', password='***')
    conn_params = pika.ConnectionParameters(host="***",port=5672,heartbeat=60,ssl_options=pika.SSLOptions(context),
                                            virtual_host="test_environment",credentials=credentials)
    connection = pika.BlockingConnection(conn_params)
    channel = connection.channel()
    channel.queue_declare(queue='ssl_test')

    def callback(ch, method, properties, body):
        print(" [x] Received %r" % body)

    channel.basic_consume(queue='ssl_test', on_message_callback=callback, auto_ack=True)
    print(' [*] Waiting for messages. To exit press CTRL+C')

    channel.start_consuming()


if __name__ == '__main__':
    try:
        main()
    except KeyboardInterrupt:
        print("Interrupted")
        try:
            sys.exit(0)
        except SystemExit:
            pass
---------------------------------------------------------------------------------------------------------------------------- 
(server)
rabbit.conf
listeners.ssl.default               = 5672
ssl_options.cacertfile              = /home/dev/testca/ca_certificate.pem
ssl_options.certfile                = /home/dev/server/server_certificate.pem
ssl_options.keyfile                 = /home/dev/server/private_key.pem
ssl_options.verify                  = verify_peer
ssl_options.fail_if_no_peer_cert    = true
listeners.tcp = none
---------------------------------------------------------------------------------------------------------------------------- 
error -
ConnectionResetError: [Errno 104] Connection reset by peer
---------------------------------------------------------------------------------------------------------------------------- 

got this error - pika.exceptions.AMQPConnectionError

import pika, sys, os,ssl

def main():


    credentials = pika.PlainCredentials(username='**', password='**')
    context = ssl.create_default_context(cafile="/home/dev/Desktop/rab/ca_certificate.pem")
    context.load_cert_chain("/home/dev/Desktop/rab/client_certificate.pem",
                            "/home/dev/Desktop/rab/private_key.pem")
    ssl_options = pika.SSLOptions(context, "2*.*.*.*")
    conn_params = pika.ConnectionParameters(port=5672,heartbeat=60,ssl_options=ssl_options,
                                            virtual_host="test_environment",credentials=credentials)
    connection = pika.BlockingConnection(conn_params)
    channel = connection.channel()
    channel.queue_declare(queue='ssl_test')

    def callback(ch, method, properties, body):
        print(" [x] Received %r" % body)

    channel.basic_consume(queue='ssl_test', on_message_callback=callback, auto_ack=True)
    print(' [*] Waiting for messages. To exit press CTRL+C')

    channel.start_consuming()


if __name__ == '__main__':
    try:
        main()
    except KeyboardInterrupt:
        print("Interrupted")
        try:
            sys.exit(0)
        except SystemExit:
            pass

Luke Bakken

unread,
Dec 29, 2022, 5:50:35 PM12/29/22
to rabbitmq-users
Hello,

Is this you that asked the same question here?

Message has been deleted

james jasper

unread,
Dec 30, 2022, 12:01:36 AM12/30/22
to rabbitmq-users
Yes it was I. As the way recommended in the link was implemented, still the issue is not resolved would be a great help if you could help me out.

Luke Bakken

unread,
Dec 30, 2022, 12:34:51 AM12/30/22
to rabbitm...@googlegroups.com
You need to reply to that discussion with information as to how it's not working.

I can't read minds!

--
You received this message because you are subscribed to a topic in the Google Groups "rabbitmq-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rabbitmq-users/mr6-zlC9aqQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/ca6e3bac-7d93-4cb4-b7fa-5352aab968a3n%40googlegroups.com.

Shrikant Borole

unread,
Dec 31, 2022, 6:03:21 AM12/31/22
to rabbitm...@googlegroups.com
Nope, it's not me. Sorry I missed it.

Thanks and Regards,

Shrikant Borole
M: +91.827.551.9466  |  Nagpur, MS, 440022 | shrikan...@gmail.com



--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-user...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/rabbitmq-users/5625d938-53d5-4cac-ad44-79ea5c2da995n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages