summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Mueller <tobiasmue@gnome.org>2013-05-03 19:29:38 +0200
committerWill Thompson <will.thompson@collabora.co.uk>2013-06-26 16:55:51 +0100
commit58b7e9474a197233b58c2a400eda375d6308e5a4 (patch)
tree76457d0a3d660bb0064bcc34a9747a5d536d7662
parent7e2175d9b283a2cea1d65949b67652de00ef8a2b (diff)
dump-certificates: Manually provide server to connect to
For some reason some Google enabled domains have their DNS not set up correctly. But also working domains like vrfy.org do not work will with this tool. In order to make it connect to a XMPP server, the servername and the port can now be given as parameters. https://bugs.freedesktop.org/show_bug.cgi?id=64190
-rw-r--r--examples/dump-certificates.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/examples/dump-certificates.c b/examples/dump-certificates.c
index eb22fd7..41584a8 100644
--- a/examples/dump-certificates.c
+++ b/examples/dump-certificates.c
@@ -147,16 +147,26 @@ main (int argc,
WockyConnector *connector;
WockyTLSHandler *handler;
+ gchar* server = NULL;
+ guint port = 5222;
+
g_type_init ();
wocky_init ();
- if (argc != 2)
+ if (!(argc == 2 || argc == 4))
{
- g_printerr ("Usage: %s <jid>\n", argv[0]);
+ g_printerr ("Usage: %s <jid> [<server> <port>]\n", argv[0]);
return -1;
}
jid = argv[1];
+
+ if (argc == 4)
+ {
+ server = argv[2];
+ port = atoi(argv[3]);
+ }
+
/* This example doesn't use your real password because it does not actually
* validate certificates: it just dumps them then declares them valid.
*/
@@ -165,6 +175,8 @@ main (int argc,
mainloop = g_main_loop_new (NULL, FALSE);
handler = g_object_new (dump_tls_handler_get_type (), NULL);
connector = wocky_connector_new (jid, password, NULL, NULL, handler);
+ if (argc == 4)
+ g_object_set (G_OBJECT (connector), "xmpp-server", server, "xmpp-port", port, NULL);
wocky_connector_connect_async (connector, NULL, connected_cb, NULL);
g_main_loop_run (mainloop);