From 782fe0130fe0221923cd2ec2a2b037575315e741 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 26 Aug 2008 09:18:14 -0400 Subject: [PATCH] optionally turn encryption on or off in the XMPP connection For identi.ca, we had some problems with the XMPP daemon getting "stuck" in I/O through the encrypted (by default) XMPP socket. Turning off encryption helped. So, now it's an option. darcs-hash:20080826131814-84dde-2c4a809c6fb666dfb4b96d0d61205fe418f4e4b4.gz --- config.php.sample | 1 + lib/common.php | 1 + lib/jabber.php | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config.php.sample b/config.php.sample index e5dfdbae2a..bfcbf26a96 100644 --- a/config.php.sample +++ b/config.php.sample @@ -54,6 +54,7 @@ $config['db']['database'] = 'mysql://laconica:microblog@localhost/laconica'; #$config['xmpp']['server'] = 'server.example.net'; #$config['xmpp']['port'] = 5222; #$config['xmpp']['user'] = 'update'; +#$config['xmpp']['encryption'] = false; #$config['xmpp']['resource'] = 'uniquename'; #$config['xmpp']['password'] = 'blahblahblah'; #$config['xmpp']['public'][] = 'someindexer@example.net'; diff --git a/lib/common.php b/lib/common.php index 13c7d0d458..e4c8e9032a 100644 --- a/lib/common.php +++ b/lib/common.php @@ -86,6 +86,7 @@ $config = 'server' => 'INVALID SERVER', 'port' => 5222, 'user' => 'update', + 'encryption' => true, 'resource' => 'uniquename', 'password' => 'blahblahblah', 'host' => NULL, # only set if != server diff --git a/lib/jabber.php b/lib/jabber.php index cba7f62c4c..01ec8da439 100644 --- a/lib/jabber.php +++ b/lib/jabber.php @@ -82,7 +82,8 @@ function jabber_connect($resource=NULL) { XMPPHP_Log::LEVEL_VERBOSE : NULL ); $conn->autoSubscribe(); - + $conn->useEncryption(common_config('xmpp', 'encryption')); + if (!$conn) { return false; } -- 2.39.5