-
Notifications
You must be signed in to change notification settings - Fork 581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opensips-2.3.0 load tls_mgm.so failed (tls_mgm:mod_init: unable to set the memory allocation functions) #1114
Comments
Indeed, there seems to be a problem with the tls_mgm module and the mongo library. Basically the mongo library initializes the SSL library before the tls_mgm gets to set custom allocation modules. This breaks openssl init for tls_mgm. Any chance you could use mongodb without SSL support (I think it is possible if you compile using |
Dear razvancrainea Thanks. |
This is not something we can fix in OpenSIPS, at least not in an easy way. The only thing I can think of right now is to link opensips binary with TLS, but that seems completely broken. A workaround is to compile your postgres library without SSL support. |
Dear razvancrainea FreeSWITCH has native Postgres database support, meanwhile it has SIP TLS support, they work fine together. BTW, is it possible to compile postgres library without SSL if postgres and OPENSIPS installed on the same server? Thank you very much! Best regards. |
Hi, Jeffrey! Thanks for your suggestion; unfortunately OpenSIPS uses an OpenSSL feature that FreeSWITCH doesn't, which is exactly what breaks this module (setting the allocation functions using You can use these steps to compile libpq from sources, but make sure you are not using the |
@razvancrainea Does the above commit fixed the issue? If yes, which LTS version include the fix? |
@Jeffrey2019 yes, this has been committed in 2.4 and upper. 2.4.6 is LTS, so if you are using 2.4, you should upgrade to the latest release to get this fix. Cheers! |
Hi, loading tls_mgm as the first module on startup may fix one issue, but the same message appears if the version of openssl on the system is incompatible with tls_mgm. For those in the latter situation, upgrading to a newer opensips isn't the solution. The likely solution is to resolve the openssl library issues. After upgrading the underlying linux system, opensips(2.3.6) failed to start with the following message:
The information below contains some information that may be applicable to other users in their quest to solve this problem. The error messsage indicates openssl library incompatibity after upgrade. Module tls_mgm requires a compatible openssl 1.0.1x library and the distro now had openssl 1.1.0x. Included in the distro is a package "compat-openssl10" which is automatically installed. It is supposed to allow openssl 1.0.1x compatible programs to still function. However, it was not working for tls_mgm, and after recompiling opensips, tls_mgm was including the system's openssl 1.1 headers and libs and not the 1.0 compat. To solve this, because downgrading anything was not an option, "compat-openssl110" was uninstalled and it dragged mongodb and a few other packages along with it. Mongodb was a required package, so instead of using mongodb from the official repository, disabling the mongodb repo and installing the distro version of mongodb fixed that issue. The package maintainer's version of mongo used openssl 1.1 For tls_mgm the solution was to maintain a copy of openssl 1.0.1o on the server.
|
1 runtime
opensips start cmdline
./opensips -M 8 -f ../custom.cfg
load related module:
2.tls_mgm init error
3.1
openssl Compile Options
./config -g3 shared zlib-dynamic --prefix=/
try openssl-1.0.1t,openssl-1.0.2h,openssl-1.0.1q and so on
replace openssl verion (rm -rf xxx & ln -s xxxx)
recompile openssl-2.3.0 (make clean&make&make install)
./opensips -M 8 -f ../custom.cfg
init tls_mgm error
3.2
try openssl Compile Options(fips)
./config -g3 fips shared zlib-dynamic --prefix=/
try openssl-1.0.1t,openssl-1.0.2h,openssl-1.0.1q and so on
replace openssl verion (rm -rf xxx & ln -s xxxx)
recompile openssl-2.3.0 (make clean&make&make install)
./opensips -M 8 -f ../custom.cfg
init tls_mgm error
4 gdb opensips
4 remove cachedb_mongodb.so
remove cachedb_mongodb.so&mongodb related route logic
mongoc-driver-libs related ssl maybe corrupt tls_mgm.so
after remove cachedb_mongodb.so,opensips-2.3.0 successfully start (include tls_mgm.so) above
5 bug?
at present adjust cache-store(redis), don't use mongo;
the tls_mgm.c error-hint look like some mistake;
cache_mongo&tls_mgm modules corrupts related on ssl funnction?
The text was updated successfully, but these errors were encountered: