Mosquitto with LDAP Authentication

Asked by Alex

Hello everyone, I'm trying to setup a mosquitto server for my own IM.
But I cannot figure out how to make mosquitto with LDAP Authentication.
Is there anybody know how to deal with LDAP in mosquitto?

Thanks a lot.

Question information

Language:
English Edit question
Status:
Solved
For:
mosquitto Edit question
Assignee:
No assignee Edit question
Solved by:
Alex
Solved:
Last query:
Last reply:
Revision history for this message
Alex (yangyuting468) said :
#1

I figure out there's a plugin called "mosquitto-auth-plugin" can do this.
But when I use the mosquitto source file to do the make operation, it reports an error as the following:

"cc -shared -Wl,--version-script=linker.version -Wl,-soname,libmosquitto.so.1 mosquitto.o logging_mosq.o memory_mosq.o messages_mosq.o net_mosq.o read_handle.o read_handle_client.o read_handle_shared.o send_mosq.o send_client_mosq.o srv_mosq.o thread_mosq.o time_mosq.o tls_mosq.o util_mosq.o will_mosq.o -o libmosquitto.so.1 -lrt -lssl -lcrypto -lpthread
/usr/bin/ld: cannot find -lrt
collect2: ld returned 1 exit status
make[1]: *** [libmosquitto.so.1] Error 1
make[1]: Leaving directory `/root/yangyuting468/mosquitto-1.3.5/lib'
make: *** [mosquitto] Error 2"

How can I solve this problem?

Thanks a lot.

Revision history for this message
Alex (yangyuting468) said :
#2

Hello everyone,

I solved the problem above now. But I cannot build mosquitto by source as well.
Here is the error:

cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c mosquitto.c -o mosquitto.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c logging_mosq.c -o logging_mosq.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c memory_mosq.c -o memory_mosq.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c messages_mosq.c -o messages_mosq.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c net_mosq.c -o net_mosq.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c read_handle.c -o read_handle.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c read_handle_client.c -o read_handle_client.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c read_handle_shared.c -o read_handle_shared.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c send_mosq.c -o send_mosq.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c send_client_mosq.c -o send_client_mosq.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c srv_mosq.c -o srv_mosq.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c thread_mosq.c -o thread_mosq.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c time_mosq.c -o time_mosq.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c tls_mosq.c -o tls_mosq.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c util_mosq.c -o util_mosq.o
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_TLS -DWITH_TLS_PSK -DWITH_THREADING -c will_mosq.c -o will_mosq.o
cc -shared -Wl,--version-script=linker.version -Wl,-soname,libmosquitto.so.1 mosquitto.o logging_mosq.o memory_mosq.o messages_mosq.o net_mosq.o read_handle.o read_handle_client.o read_handle_shared.o send_mosq.o send_client_mosq.o srv_mosq.o thread_mosq.o time_mosq.o tls_mosq.o util_mosq.o will_mosq.o -o libmosquitto.so.1 -lrt -lssl -lcrypto -lpthread
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../lib64/librt.a(clock_gettime.o): relocation R_X86_64_PC32 against undefined symbol `__errno_location@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[1]: *** [libmosquitto.so.1] Error 1
make[1]: Leaving directory `/root/yangyuting468/mqtt/mosquitto-1.3.5/lib'
make: *** [mosquitto] Error 2

Can you help me to solve it ?

Revision history for this message
Roger Light (roger.light) said :
#3

What system are you compiling on?

Revision history for this message
Alex (yangyuting468) said :
#4

Hello Roger,

My compiling system is RHEL6.5 64bit.
Thanks.

Revision history for this message
Roger Light (roger.light) said :
#5

In that case I'm afraid I have no idea. It compiles just fine on Centos 6 on build.opensuse.org.

Revision history for this message
Alex (yangyuting468) said :
#6

Hi Roger,

Never mind, I use Apollo and solve this problem now.
Thanks