[ejabberd] getting started with ejabberd...

Alexey Shchepin alexey at sevcom.net
Thu Aug 28 23:30:03 MSD 2003

Hello, Marshall!

On Wed, 27 Aug 2003 09:44:26 -0700, you said:

 MR> so, i removed the ssl lines in the config file and tried again. this time
 MR> it starts fine, great!

 MR> however, when i try to register (by logging in with tkabber), the
 MR> connection gets dropped (cf., attached ejabberd.log).

 MR> at this point, i have to ask whether anyone is actually using ejabberd as
 MR> it exists in cvs... perhaps there was a stable version checked-in a while
 MR> back which they're using...

This version works at least on e.jabber.ru, on jabber.ttn.ru as IRC gateway,
and on my machine (of course :).  I'm sure this problem because of

 MR> seem like this stuff ought to work, but the ssl problem is clearly some
 MR> kind of a syntax error in the code...

This backtrace from ejabberd.log:

** Reason for termination = 
** {badarg,[{erlang,port_control,

means that process failed in call to crypto_drv.so (calculating md5 hash from
string "mrose:miz-mishtal.dbc.mtview.ca.us:test") in calculating of response
for DIGEST-MD5 algorithm.

Try to do this:

% erl
Erlang (BEAM) emulator version 5.1 [source]

Eshell V5.1  (abort with ^G)
1> crypto:start().
2> crypto:md5("abc").

If you will get error, then check if crypto_drv.so compiles fine.  Below are
some messages from erlang-questions mailing list that may help.

From: Kent Boortz <kent at erix.ericsson.se>
Subject: Re: problem building R9B-1 crypto under FreeBSD 4.8-RC2
To: Chris Pressey <cpressey at catseye.mb.ca>
Cc: erlang-questions at erlang.org
Date: 23 Mar 2003 19:46:05 +0100

Chris Pressey <cpressey at catseye.mb.ca> writes:
> This is on a fresh FreeBSD 4.8-RC2 install (well, virtually fresh - I did
> one 'make update / make world' on it, last night, and there were only a
> handful of diffs.)  I think (am guessing) this might have something to do
> with the recent import of openssl 0.97 into 4.8-RC2.

Hopefully the patch from Jimmy Olgeni <olgeni at uli.it> included below
will correct this problem,


Building with OpenSSL 0.9.7 requires this patch:

--- lib/crypto/c_src/crypto_drv.c.orig	Thu Oct 21 15:37:08 1999
+++ lib/crypto/c_src/crypto_drv.c	Mon Mar  3 15:12:27 2003
@@ -29,6 +29,7 @@
 #include <string.h>
 #include "erl_driver.h"

 #include "des.h"
 #include "md5.h"
 #include "sha.h"

From: Anastasia Gornostaeva <ermine at ermine.pp.ru>
Subject: Re: crypto
To: erlang-questions at erlang.org
Date: Fri, 18 Apr 2003 13:43:58 +0400

On Thu, Apr 17, 2003 at 01:14:47PM +0400, Anastasia Gornostaeva wrote:
> On FreeBSD, we have:
> bash-2.05b$ erl
> Erlang (BEAM) emulator version [source] [hipe] [threads:0]
> Eshell V5.2.3.3  (abort with ^G)
> 1> crypto:start().
> crypto_drv:start : function 9 not initialized
>                                              {error,{shutdown,{crypto_app,start,[normal,[]]}}}
> =INFO REPORT==== 17-Apr-2003::13:09:09 ===
>     application: crypto
>     exited: {shutdown,{crypto_app,start,[normal,[]]}}
>     type: temporary
> 2> 
> Why? Please give a good solution.

Patch is for FreeBSD 4.8 and is below. Big thanks to Alexander Timoshenko.


diff -ur lib/crypto.old/c_src/Makefile.in lib/crypto/c_src/Makefile.in
--- lib/crypto.old/c_src/Makefile.in	Fri Apr 18 10:20:27 2003
+++ lib/crypto/c_src/Makefile.in	Fri Apr 18 10:20:58 2003
@@ -107,9 +107,9 @@
 	-u SHA1_Init \
 	-u SHA1_Update \
 	-u SHA1_Final \
-	-u des_set_key \
-	-u des_ncbc_encrypt \
-	-u des_ede3_cbc_encrypt
+	-u DES_set_key \
+	-u DES_ncbc_encrypt \
+	-u DES_ede3_cbc_encrypt
 # ----------------------------------------------------
diff -ur lib/crypto.old/c_src/crypto_drv.c lib/crypto/c_src/crypto_drv.c
--- lib/crypto.old/c_src/crypto_drv.c	Fri Apr 18 10:20:27 2003
+++ lib/crypto/c_src/crypto_drv.c	Fri Apr 18 10:21:19 2003
@@ -208,9 +208,9 @@
     cfs.SHA1_Init = driver_dl_sym(lib_handle, "SHA1_Init");
     cfs.SHA1_Update = driver_dl_sym(lib_handle, "SHA1_Update");
     cfs.SHA1_Final = driver_dl_sym(lib_handle, "SHA1_Final");
-    cfs.des_set_key = driver_dl_sym(lib_handle, "des_set_key");
-    cfs.des_ncbc_encrypt = driver_dl_sym(lib_handle, "des_ncbc_encrypt");
-    cfs.des_ede3_cbc_encrypt = driver_dl_sym(lib_handle, "des_ede3_cbc_encrypt");
+    cfs.des_set_key = driver_dl_sym(lib_handle, "DES_set_key");
+    cfs.des_ncbc_encrypt = driver_dl_sym(lib_handle, "DES_ncbc_encrypt");
+    cfs.des_ede3_cbc_encrypt = driver_dl_sym(lib_handle, "DES_ede3_cbc_encrypt");
     /* Check that all pointer where initialized */
     for (i = 0; i < sizeof(crypto_funcs)/sizeof(void*); i++) {

From: Vladimir Sekissov <svg at surnet.ru>
Subject: Re: crypto
To: ermine at ermine.pp.ru
Cc: erlang-questions at erlang.org
Date: Thu, 17 Apr 2003 19:35:29 +0600 (YEKST)

Good day,

Try to discover $ERL_TOP/lib/crypto-*.*.*/priv/lib/elibcrypto.so:

1. nm -a elibcrypto.so | grep des_set_key

Output must be something like:

00004b80 T des_set_key

2. Look that it can find all libraries it wants:

ldd elibcrypto.so

3. If you installed Erlang from ports try to recompile driver manually
using patch from


Best Regards,
Vladimir Sekissov

ermine> On FreeBSD, we have:
ermine> bash-2.05b$ erl
ermine> Erlang (BEAM) emulator version [source] [hipe] [threads:0]
ermine> Eshell V5.2.3.3  (abort with ^G)
ermine> 1> crypto:start().
ermine> crypto_drv:start : function 9 not initialized
ermine>                                              {error,{shutdown,{crypto_app,start,[normal,[]]}}}
ermine> =INFO REPORT==== 17-Apr-2003::13:09:09 ===
ermine>     application: crypto
ermine>     exited: {shutdown,{crypto_app,start,[normal,[]]}}
ermine>     type: temporary
ermine> 2> 
ermine> Why? Please give a good solution.
ermine> ermine

More information about the ejabberd mailing list