Function amqp_initialize_ssl_library

Synopsis

#include <librabbitmq/amqp_ssl_socket.h>

int amqp_initialize_ssl_library(void)

Description

Initialize the underlying SSL/TLS library.

The OpenSSL library requires a one-time initialization across the whole program.

This function unconditionally initializes OpenSSL so that rabbitmq-c may use it.

This function is thread-safe, and may be called more than once.

Return
AMQP_STATUS_OK on success.
Since
v0.9.0

Source

Lines 647-663 in librabbitmq/amqp_openssl.c. Line 256 in librabbitmq/amqp_ssl_socket.h.

int amqp_initialize_ssl_library(void) {
  int status;
  CHECK_SUCCESS(pthread_mutex_lock(&openssl_init_mutex));

  if (!openssl_initialized) {
    status = setup_openssl();
    if (status) {
      goto out;
    }
    openssl_initialized = 1;
  }

  status = AMQP_STATUS_OK;
out:
  CHECK_SUCCESS(pthread_mutex_unlock(&openssl_init_mutex));
  return status;
}





Add Discussion as Guest

Log in to DocsForge