summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMichael Steinert <mike.steinert@gmail.com>2012-11-29 12:08:59 -0700
committerAlan Antonuk <alan.antonuk@gmail.com>2013-04-09 15:54:00 -0700
commitdc835960a2773485094306b557e5fc2aa1f43c60 (patch)
tree025a1ae2a43e04252e6d8c5e698ed29bde445000 /examples
parent696df0ed2f705184cda8a1279345a58b42b21db0 (diff)
downloadrabbitmq-c-dc835960a2773485094306b557e5fc2aa1f43c60.tar.gz
Set the client key/cert in one API call
It doesn't make much sense to have separate APIs to set the client key/cert pair. This change also make it easier to port to other backends. Signed-off-by: Michael Steinert <mike.steinert@gmail.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/amqps_bind.c9
-rw-r--r--examples/amqps_consumer.c9
-rw-r--r--examples/amqps_exchange_declare.c9
-rw-r--r--examples/amqps_listen.c9
-rw-r--r--examples/amqps_listenq.c9
-rw-r--r--examples/amqps_producer.c9
-rw-r--r--examples/amqps_sendstring.c9
-rw-r--r--examples/amqps_unbind.c9
8 files changed, 8 insertions, 64 deletions
diff --git a/examples/amqps_bind.c b/examples/amqps_bind.c
index 04db414..050be73 100644
--- a/examples/amqps_bind.c
+++ b/examples/amqps_bind.c
@@ -75,15 +75,8 @@ int main(int argc, char const * const *argv) {
}
}
- if (argc > 7) {
- status = amqp_ssl_socket_set_key(socket, argv[7]);
- if (status) {
- die("setting client key");
- }
- }
-
if (argc > 8) {
- status = amqp_ssl_socket_set_cert(socket, argv[8]);
+ status = amqp_ssl_socket_set_key(socket, argv[8], argv[7]);
if (status) {
die("setting client cert");
}
diff --git a/examples/amqps_consumer.c b/examples/amqps_consumer.c
index 86c9d9f..cccbe33 100644
--- a/examples/amqps_consumer.c
+++ b/examples/amqps_consumer.c
@@ -147,15 +147,8 @@ int main(int argc, char const * const *argv) {
}
}
- if (argc > 4) {
- status = amqp_ssl_socket_set_key(socket, argv[4]);
- if (status) {
- die("setting client key/cert");
- }
- }
-
if (argc > 5) {
- status = amqp_ssl_socket_set_cert(socket, argv[5]);
+ status = amqp_ssl_socket_set_key(socket, argv[5], argv[4]);
if (status) {
die("setting client key");
}
diff --git a/examples/amqps_exchange_declare.c b/examples/amqps_exchange_declare.c
index 12c814b..bcf30b1 100644
--- a/examples/amqps_exchange_declare.c
+++ b/examples/amqps_exchange_declare.c
@@ -73,15 +73,8 @@ int main(int argc, char const * const *argv) {
}
}
- if (argc > 6) {
- status = amqp_ssl_socket_set_key(socket, argv[6]);
- if (status) {
- die("setting client key/cert");
- }
- }
-
if (argc > 7) {
- status = amqp_ssl_socket_set_cert(socket, argv[7]);
+ status = amqp_ssl_socket_set_key(socket, argv[7], argv[6]);
if (status) {
die("setting client key/cert");
}
diff --git a/examples/amqps_listen.c b/examples/amqps_listen.c
index 876bad9..25f8371 100644
--- a/examples/amqps_listen.c
+++ b/examples/amqps_listen.c
@@ -77,15 +77,8 @@ int main(int argc, char const * const *argv) {
}
}
- if (argc > 6) {
- status = amqp_ssl_socket_set_key(socket, argv[6]);
- if (status) {
- die("setting client key");
- }
- }
-
if (argc > 7) {
- status = amqp_ssl_socket_set_cert(socket, argv[7]);
+ status = amqp_ssl_socket_set_key(socket, argv[7], argv[6]);
if (status) {
die("setting client cert");
}
diff --git a/examples/amqps_listenq.c b/examples/amqps_listenq.c
index 9d910c9..2bb1760 100644
--- a/examples/amqps_listenq.c
+++ b/examples/amqps_listenq.c
@@ -73,15 +73,8 @@ int main(int argc, char const * const *argv) {
}
}
- if (argc > 5) {
- status = amqp_ssl_socket_set_key(socket, argv[5]);
- if (status) {
- die("setting client key");
- }
- }
-
if (argc > 6) {
- status = amqp_ssl_socket_set_cert(socket, argv[5]);
+ status = amqp_ssl_socket_set_key(socket, argv[6], argv[5]);
if (status) {
die("setting client cert");
}
diff --git a/examples/amqps_producer.c b/examples/amqps_producer.c
index 18f0b3f..866f8f8 100644
--- a/examples/amqps_producer.c
+++ b/examples/amqps_producer.c
@@ -137,15 +137,8 @@ int main(int argc, char const * const *argv) {
}
}
- if (argc > 6) {
- status = amqp_ssl_socket_set_key(socket, argv[6]);
- if (status) {
- die("setting client key");
- }
- }
-
if (argc > 7) {
- status = amqp_ssl_socket_set_cert(socket, argv[7]);
+ status = amqp_ssl_socket_set_key(socket, argv[7], argv[6]);
if (status) {
die("setting client cert");
}
diff --git a/examples/amqps_sendstring.c b/examples/amqps_sendstring.c
index 1133dcf..c1f10df 100644
--- a/examples/amqps_sendstring.c
+++ b/examples/amqps_sendstring.c
@@ -75,15 +75,8 @@ int main(int argc, char const * const *argv) {
}
}
- if (argc > 7) {
- status = amqp_ssl_socket_set_key(socket, argv[7]);
- if (status) {
- die("setting client key");
- }
- }
-
if (argc > 8) {
- status = amqp_ssl_socket_set_cert(socket, argv[8]);
+ status = amqp_ssl_socket_set_key(socket, argv[8], argv[7]);
if (status) {
die("setting client cert");
}
diff --git a/examples/amqps_unbind.c b/examples/amqps_unbind.c
index 5c8a4b5..58a6730 100644
--- a/examples/amqps_unbind.c
+++ b/examples/amqps_unbind.c
@@ -75,15 +75,8 @@ int main(int argc, char const * const *argv) {
}
}
- if (argc > 7) {
- status = amqp_ssl_socket_set_key(socket, argv[7]);
- if (status) {
- die("setting client key");
- }
- }
-
if (argc > 8) {
- status = amqp_ssl_socket_set_cert(socket, argv[8]);
+ status = amqp_ssl_socket_set_key(socket, argv[8], argv[7]);
if (status) {
die("setting client cert");
}