0

I am having trouble using cppyy to execute some c++ code which tries to connect to a RabbitMQ instance with SSL.

The code to start the SSL connection is very similar to the amqp_ssl_connect.c example here. Most notably where I am having issue is when amqp tries to create a new socket.

  conn = amqp_new_connection();
  LOG_INFO("Created new AMQP connection - %u", m_conn);
  socket = amqp_ssl_socket_new(conn);
  LOG_INFO("Created new SSL socket - %u", m_socket);
  if (!socket) {
    die("creating SSL/TLS socket");
  }

My cppyy code tries to run the above block and I can see the connection object being made but socket always returns as 0 (NULL) and is unable to proceed forward.

If we look at the source code for amqp_ssl_socket_new we can see the beginning of the definition for the function:

  struct amqp_ssl_socket_t *self = calloc(1, sizeof(*self));
  int status;
  if (!self) {
    return NULL;
  }

I'm wondering if the calloc call is what the issue might be. Just looking to see if someone has had a similar problem or some insights into this?

D.L
  • 4,339
  • 5
  • 22
  • 45
sohmahmood
  • 11
  • 3

0 Answers0