Skip to content

AMQP-CPP seems to not work on secure connections on Windows #568

@josepvabr

Description

@josepvabr

I am studying AMQP-CPP as a solution to create a windows application. My first impulse was to try to use TcpHandler and TcpConnection but it seems to work only on linux, which is no good to me. Then I´ve tried to create my own Handler. I create a test command line windows application (source code attached) and I was succesful in connecting to a broker using unsecure connection but when I try to connect using secure connection AMQP-CPP seems to not complete the full amqp protocol handshake.

When I connect without cryptografy the application runs fine. As we can see bellow:

AMQP-Test001> .\build\AMQP-Test001.exe --consumer --port 5672 --heartbeat 4
Connected to 4.201.106.231:5672
Connection is ready!
Sent 8 bytes
Received 514 bytes
Sent 512 bytes
Received 20 bytes
Negotiating heartbeat interval: 60 seconds
Using heartbeat interval: 2 seconds
Sent 20 bytes
Sent 23 bytes
Received 13 bytes -> This 13 bytes are never received using secure connection
Connected to RabbitMQ server
Sent 13 bytes
Received 16 bytes
Sent 31 bytes
Received 44 bytes
Received 8 bytes
Received heartbeat from RabbitMQ server
Sent 8 bytes
Received 8 bytes
Received heartbeat from RabbitMQ server
Sent 8 bytes
Received 8 bytes

But, when I try to use secure connections this happens:
AMQP-Test001> .\build\AMQP-Test001.exe --consumer --port 5671 --heartbeat 4 --use_ssl
Connected to 4.201.106.231:5671
SSL handshake successful
Connection is ready!
Sent 8 bytes
Received 514 bytes
Sent 512 bytes
Received 20 bytes
Negotiating heartbeat interval: 60 seconds
Using heartbeat interval: 2 seconds
Sent 20 bytes
Sent 23 bytes -> Seems AMQP-CPP should do something different in the amqp protocol handshake
Received 8 bytes -> The server is sending heartbeats packets.
Received heartbeat from RabbitMQ server
Received 8 bytes
Received heartbeat from RabbitMQ server
Received 8 bytes
Received heartbeat from RabbitMQ server
Received 8 bytes
Received heartbeat from RabbitMQ server
Received 0 bytes
Failed to read data: End of file -> But the connection evetualy time outs.

The TcpConnection class has a onSecured virtual method but not the ConnectionHandler class. I don´t know if this should trigger additional
handshake messages to make the secure server connection.

Can you help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions