summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--librabbitmq/amqp_openssl.c7
-rw-r--r--librabbitmq/amqp_ssl_socket.h13
2 files changed, 20 insertions, 0 deletions
diff --git a/librabbitmq/amqp_openssl.c b/librabbitmq/amqp_openssl.c
index 1fac25d..4915a6a 100644
--- a/librabbitmq/amqp_openssl.c
+++ b/librabbitmq/amqp_openssl.c
@@ -363,6 +363,13 @@ error:
return NULL;
}
+void *amqp_ssl_socket_get_context(amqp_socket_t *base) {
+ if (base->klass != &amqp_ssl_socket_class) {
+ amqp_abort("<%p> is not of type amqp_ssl_socket_t", base);
+ }
+ return ((struct amqp_ssl_socket_t *)base)->ctx;
+}
+
int amqp_ssl_socket_set_cacert(amqp_socket_t *base, const char *cacert) {
int status;
struct amqp_ssl_socket_t *self;
diff --git a/librabbitmq/amqp_ssl_socket.h b/librabbitmq/amqp_ssl_socket.h
index 9977ae4..70d1a56 100644
--- a/librabbitmq/amqp_ssl_socket.h
+++ b/librabbitmq/amqp_ssl_socket.h
@@ -58,6 +58,19 @@ AMQP_PUBLIC_FUNCTION
amqp_socket_t *AMQP_CALL amqp_ssl_socket_new(amqp_connection_state_t state);
/**
+ * Get the internal OpenSSL context. Caveat emptor.
+ *
+ * \param [in,out] self An SSL/TLS socket object.
+ *
+ * \return A pointer to the internal OpenSSL context. This should be cast to
+ * <tt>SSL_CTX*</tt>.
+ *
+ * \since v0.9.0
+ */
+AMQP_PUBLIC_FUNCTION
+void *AMQP_CALL amqp_ssl_socket_get_context(amqp_socket_t *self);
+
+/**
* Set the CA certificate.
*
* \param [in,out] self An SSL/TLS socket object.