rabbitmq-c  0.8.0
C AMQP Client library for RabbitMQ
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
amqp_ssl_socket.h
Go to the documentation of this file.
1 /* vim:set ft=c ts=2 sw=2 sts=2 et cindent: */
3 /*
4  * Portions created by Alan Antonuk are Copyright (c) 2013-2014 Alan Antonuk.
5  * All Rights Reserved.
6  *
7  * Portions created by Michael Steinert are Copyright (c) 2012-2013 Michael
8  * Steinert. All Rights Reserved.
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining a
11  * copy of this software and associated documentation files (the "Software"),
12  * to deal in the Software without restriction, including without limitation
13  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  * and/or sell copies of the Software, and to permit persons to whom the
15  * Software is furnished to do so, subject to the following conditions:
16  *
17  * The above copyright notice and this permission notice shall be included in
18  * all copies or substantial portions of the Software.
19  *
20  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  * DEALINGS IN THE SOFTWARE.
27  */
28 
29 #ifndef AMQP_SSL_H
30 #define AMQP_SSL_H
31 
32 #include <amqp.h>
33 
34 AMQP_BEGIN_DECLS
35 
57 AMQP_PUBLIC_FUNCTION
58 amqp_socket_t *
59 AMQP_CALL
61 
73 AMQP_PUBLIC_FUNCTION
74 int
75 AMQP_CALL
76 amqp_ssl_socket_set_cacert(amqp_socket_t *self,
77  const char *cacert);
78 
91 AMQP_PUBLIC_FUNCTION
92 int
93 AMQP_CALL
94 amqp_ssl_socket_set_key(amqp_socket_t *self,
95  const char *cert,
96  const char *key);
97 
111 AMQP_PUBLIC_FUNCTION
112 int
113 AMQP_CALL
114 amqp_ssl_socket_set_key_buffer(amqp_socket_t *self,
115  const char *cert,
116  const void *key,
117  size_t n);
118 
134 AMQP_DEPRECATED(
135  AMQP_PUBLIC_FUNCTION
136  void
137  AMQP_CALL
138  amqp_ssl_socket_set_verify(amqp_socket_t *self, amqp_boolean_t verify)
139 );
140 
152 AMQP_PUBLIC_FUNCTION
153 void
154 AMQP_CALL
155 amqp_ssl_socket_set_verify_peer(amqp_socket_t *self, amqp_boolean_t verify);
156 
166 AMQP_PUBLIC_FUNCTION
167 void
168 AMQP_CALL
169 amqp_ssl_socket_set_verify_hostname(amqp_socket_t *self, amqp_boolean_t verify);
170 
171 typedef enum {
172  AMQP_TLSv1 = 1,
173  AMQP_TLSv1_1 = 2,
174  AMQP_TLSv1_2 = 3,
175  AMQP_TLSvLATEST = 0xFFFF
176 } amqp_tls_version_t;
177 
194 AMQP_PUBLIC_FUNCTION
195 int
196 AMQP_CALL
197 amqp_ssl_socket_set_ssl_versions(amqp_socket_t *self,
198  amqp_tls_version_t min,
199  amqp_tls_version_t max);
200 
225 AMQP_PUBLIC_FUNCTION
226 void
227 AMQP_CALL
229 
230 AMQP_END_DECLS
231 
232 #endif /* AMQP_SSL_H */
amqp_socket_t * amqp_ssl_socket_new(amqp_connection_state_t state)
Create a new SSL/TLS socket object.
int amqp_ssl_socket_set_key(amqp_socket_t *self, const char *cert, const char *key)
Set the client key.
void amqp_set_initialize_ssl_library(amqp_boolean_t do_initialize)
Sets whether rabbitmq-c initializes the underlying SSL library.
int amqp_ssl_socket_set_ssl_versions(amqp_socket_t *self, amqp_tls_version_t min, amqp_tls_version_t max)
Set min and max TLS versions.
int amqp_boolean_t
boolean type 0 = false, true otherwise
Definition: amqp.h:368
int amqp_ssl_socket_set_key_buffer(amqp_socket_t *self, const char *cert, const void *key, size_t n)
Set the client key from a buffer.
void amqp_ssl_socket_set_verify_hostname(amqp_socket_t *self, amqp_boolean_t verify)
Enable or disable hostname verification.
int amqp_ssl_socket_set_cacert(amqp_socket_t *self, const char *cacert)
Set the CA certificate.
void amqp_ssl_socket_set_verify(amqp_socket_t *self, amqp_boolean_t verify)
Enable or disable peer verification.
void amqp_ssl_socket_set_verify_peer(amqp_socket_t *self, amqp_boolean_t verify)
Enable or disable peer verification.
struct amqp_connection_state_t_ * amqp_connection_state_t
connection state object
Definition: amqp.h:665