• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..15-Apr-2021-

MakefileH A D15-Apr-2021746 2719

README.mdH A D15-Apr-20211.9 KiB6444

openssl_mutex_shared.cH A D15-Apr-20211.5 KiB4739

README.md

1# OpenSSL Shared Mutex #
2
3**IMPORTANT: the workaround of using this preloaded shared library is no longer
4needed starting with Kamailio v5.3.0-pre1 (git master branch after September 14, 2019).
5The code of this shared library has been included in the core of Kamailio and the
6same behaviour is now achieved by default.**
7
8This is a shared library required as a short term workaround for using Kamailio
9with OpenSSL (libssl) v1.1. It has to be pre-loaded before starting Kamailio.
10
11In v1.1, libssl does not allow setting custom locking functions, using internally
12pthread mutexes and rwlocks, but they are not initialized with process shared
13option (PTHREAD_PROCESS_SHARED), which can result in blocking Kamailio worker
14processes.
15
16## Installation ##
17
18By default, it is installed when the tls module is installed.
19
20It can be installed manually, in this folder execute:
21
22```
23make
24make install
25```
26
27It is installed at the same place where Kamailio deploys the directory with
28modules.
29
30For example, when installing from sources on a 64b system, the location is:
31
32```
33/usr/local/lib64/kamailio/openssl_mutex_shared/openssl_mutex_shared.so
34```
35
36For Debian packing, the location is like:
37
38```
39/usr/lib/x86_64-linux-gnu/kamailio/openssl_mutex_shared/openssl_mutex_shared.so
40```
41
42Note: there is no dependency on Kamailio source code, this shared object can
43be compiled and used ouside of Kamailio source tree. It uses only Kamailio's
44Makefile system to install in the same directory like the other shared objects
45installed by Kamailio.
46
47## Usage ##
48
49Use LD_PRELOAD to tell the linker to preload this shared object before starting
50Kamailio.
51
52Example, when Kamailio was installed from sources:
53
54```
55LD_PRELOAD=/usr/local/lib64/kamailio/openssl_mutex_shared/openssl_mutex_shared.so \
56  /usr/local/sbin/kamailio -f /usr/local/etc/kamailio/kamailio.cfg
57```
58
59If using systemd, add to service file:
60
61```
62Environment='LD_PRELOAD=/usr/local/lib64/kamailio/openssl_mutex_shared/openssl_mutex_shared.so'
63```
64