Hello,
I am using letsencrypt cert and key and do not want to restart kamailio every 3 months to load new ones.
I know that there is: kamcmd tls.reload method but it has an error for me.
error: 500 - Error while fixing TLS configuration (consult server log)
I am checking the logs and see:
kamailio[3865480]: INFO: tls [tls_domain.c:345]: ksr_tls_fill_missing(): TLSs<default>: tls_method=3
kamailio[3865480]: INFO: tls [tls_domain.c:357]: ksr_tls_fill_missing(): TLSs<default>: certificate='/etc/kamailio/certs/my_cert.crt'
kamailio[3865480]: INFO: tls [tls_domain.c:364]: ksr_tls_fill_missing(): TLSs<default>: ca_list='(null)'
kamailio[3865480]: INFO: tls [tls_domain.c:371]: ksr_tls_fill_missing(): TLSs<default>: ca_path='(null)'
kamailio[3865480]: INFO: tls [tls_domain.c:378]: ksr_tls_fill_missing(): TLSs<default>: crl='(null)'
kamailio[3865480]: INFO: tls [tls_domain.c:382]: ksr_tls_fill_missing(): TLSs<default>: require_certificate=0
kamailio[3865480]: INFO: tls [tls_domain.c:390]: ksr_tls_fill_missing(): TLSs<default>: cipher_list='(null)'
kamailio[3865480]: INFO: tls [tls_domain.c:397]: ksr_tls_fill_missing(): TLSs<default>: private_key='/etc/kamailio/certs/private.key'
kamailio[3865480]: INFO: tls [tls_domain.c:401]: ksr_tls_fill_missing(): TLSs<default>: verify_certificate=0
kamailio[3865480]: INFO: tls [tls_domain.c:406]: ksr_tls_fill_missing(): TLSs<default>: verify_depth=9
kamailio[3865480]: INFO: tls [tls_domain.c:410]: ksr_tls_fill_missing(): TLSs<default>: verify_client=0
kamailio[3865480]: NOTICE: tls [tls_domain.c:1168]: ksr_tls_fix_domain(): registered server_name callback handler for socket [:0], server_name='<default>' ...
kamailio[3865480]: ERROR: tls [tls_domain.c:590]: load_cert(): TLSs<default>: Unable to load certificate file '/etc/kamailio/certs/my_cert.crt'
kamailio[3865480]: ERROR: tls [tls_util.h:49]: tls_err_ret(): load_cert:error:03000072:digital envelope routines::decode error (sni: unknown)
kamailio[3865480]: ERROR: tls [tls_util.h:49]: tls_err_ret(): load_cert:error:0A00018F:SSL routines::ee key too small (sni: unknown)
Any advice ?
It's interesting that there are not any TLS errors in case I restart kamailio. I can make TLS calls without problems.
deb 12.5
version: kamailio 5.7.4 (x86_64/linux)
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4033
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4033(a)github.com>
Module: kamailio
Branch: master
Commit: 8e398b8675079e1baac7c7575e70283175cdebe2
URL: https://github.com/kamailio/kamailio/commit/8e398b8675079e1baac7c7575e70283…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-12-09T19:04:25+01:00
lib/srdb1: new and free connection callbacks expect one parameter
- new connection is executetd with a database id and free connection
with a pool con
- compiler warnings:
src/lib/srdb1/db.c:322:23: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
322 | con = new_connection(id);
src/lib/srdb1/db.c:361:18: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
361 | free_connection(con);
---
Modified: src/lib/srdb1/db.c
Modified: src/lib/srdb1/db.h
---
Diff: https://github.com/kamailio/kamailio/commit/8e398b8675079e1baac7c7575e70283…
Patch: https://github.com/kamailio/kamailio/commit/8e398b8675079e1baac7c7575e70283…
---
diff --git a/src/lib/srdb1/db.c b/src/lib/srdb1/db.c
index b13d87c692b..77dea84df52 100644
--- a/src/lib/srdb1/db.c
+++ b/src/lib/srdb1/db.c
@@ -270,7 +270,7 @@ int db_bind_mod(const str *mod, db_func_t *mydbf)
* Initialize database module
* \note No function should be called before this
*/
-db1_con_t *db_do_init(const str *url, void *(*new_connection)())
+db1_con_t *db_do_init(const str *url, void *(*new_connection)(struct db_id *))
{
return db_do_init2(url, *new_connection, DB_POOLING_PERMITTED);
}
@@ -280,8 +280,8 @@ db1_con_t *db_do_init(const str *url, void *(*new_connection)())
* Initialize database module
* \note No function should be called before this
*/
-db1_con_t *db_do_init2(
- const str *url, void *(*new_connection)(), db_pooling_t pooling)
+db1_con_t *db_do_init2(const str *url, void *(*new_connection)(struct db_id *),
+ db_pooling_t pooling)
{
struct db_id *id;
void *con;
@@ -347,7 +347,7 @@ db1_con_t *db_do_init2(
* Shut down database module
* \note No function should be called after this
*/
-void db_do_close(db1_con_t *_h, void (*free_connection)())
+void db_do_close(db1_con_t *_h, void (*free_connection)(struct pool_con *))
{
struct pool_con *con;
diff --git a/src/lib/srdb1/db.h b/src/lib/srdb1/db.h
index 248647ecd07..a9538f6b9ca 100644
--- a/src/lib/srdb1/db.h
+++ b/src/lib/srdb1/db.h
@@ -48,6 +48,8 @@
#include "db_cap.h"
#include "db_con.h"
#include "db_row.h"
+#include "db_id.h"
+#include "db_pool.h"
#include "db_pooling.h"
#include "db_locking.h"
@@ -464,7 +466,7 @@ int db_bind_mod(const str *mod, db_func_t *dbf);
* \return returns a pointer to the db1_con_t representing the connection if it was
successful, otherwise 0 is returned.
*/
-db1_con_t *db_do_init(const str *url, void *(*new_connection)());
+db1_con_t *db_do_init(const str *url, void *(*new_connection)(struct db_id *));
/**
@@ -478,8 +480,8 @@ db1_con_t *db_do_init(const str *url, void *(*new_connection)());
* \return returns a pointer to the db1_con_t representing the connection if it was
successful, otherwise 0 is returned.
*/
-db1_con_t *db_do_init2(
- const str *url, void *(*new_connection)(), db_pooling_t pooling);
+db1_con_t *db_do_init2(const str *url, void *(*new_connection)(struct db_id *),
+ db_pooling_t pooling);
/**
@@ -490,7 +492,7 @@ db1_con_t *db_do_init2(
* \param _h database connection handle
* \param (*free_connection) Pointer to the db specific free_connection method
*/
-void db_do_close(db1_con_t *_h, void (*free_connection)());
+void db_do_close(db1_con_t *_h, void (*free_connection)(struct pool_con *));
/**
Hello,
we should consider an online devel meeting sometime soon to summarize
what was done at (and still needs to be done after) devel meeting in
Dusseldorf and plan a bit the targets for next major release 6.0.
If considered useful, I propose Dec 9, 2024 (Monday) at 15:00UTC (16:00
Berlin/Paris/Madrid/Rome), but we can also look for other dates as well.
Topics to be discussed can be added at:
-
https://github.com/kamailio/kamailio-wiki/blob/main/docs/devel/irc-meetings…
Pull requests can be made by users without git access.
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
<!--
Kamailio Project uses GitHub Issues only for bugs in the code or feature requests. Please use this template only for bug reports.
If you have questions about using Kamailio or related to its configuration file, ask on sr-users mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-users.lists.kamailio…
If you have questions about developing extensions to Kamailio or its existing C code, ask on sr-dev mailing list:
* https://lists.kamailio.org/mailman3/postorius/lists/sr-dev.lists.kamailio.o…
Please try to fill this template as much as possible for any issue. It helps the developers to troubleshoot the issue.
Note that an issue report may be closed automatically after about 2 months
if there is no interest from developers or community users on pursuing it, being
considered expired. In such case, it can be reopened by writing a comment that includes
the token `/notexpired`. About two weeks before considered expired, the issue is
marked with the label `stale`, trying to notify the submitter and everyone else
that might be interested in it. To remove the label `stale`, write a comment that
includes the token `/notstale`. Also, any comment postpone the `expire` timeline,
being considered that there is interest in pursuing the issue.
If there is no content to be filled in a section, the entire section can be removed.
You can delete the comments from the template sections when filling.
You can delete next line and everything above before submitting (it is a comment).
-->
### Description
We are plotting the call success rate on each of our proxies.
Using the Kamailio snmpstats module, we try to obtain three counters in order to plot them on a graph:
- Total Calls
- Active Calls
- Error Calls
Most of the time, everything works well and we obtain sensible values:
`snmpwalk -c mycommunity -v 2c W.X.Y.Z 1.3.6.1.4.1.34352.3.1.3.1.3.2 -O n`
> .1.3.6.1.4.1.34352.3.1.3.1.3.2.1.0 = Gauge32: 309 -> Total Calls
.1.3.6.1.4.1.34352.3.1.3.1.3.2.2.0 = Gauge32: 95 -> Active Calls
.1.3.6.1.4.1.34352.3.1.3.1.3.2.3.0 = Gauge32: 214 -> Error calls
However, **when our proxies are facing intense peaks of failed calls in a short timespan**, sometimes, the **"Error Calls"** counter returns a value **higher than "Total Calls"**. As a result, **"Active Calls"** suddenly reaches a value close to the **maximum of a _Gauge32_** (because ${TotalCalls} - {ErrorCalls} < 0$).
`snmpwalk -c mycommunity -v 2c W.X.Y.Z 1.3.6.1.4.1.34352.3.1.3.1.3.2 -O n`
> .1.3.6.1.4.1.34352.3.1.3.1.3.2.1.0 = Gauge32: 153 -> Total Calls
.1.3.6.1.4.1.34352.3.1.3.1.3.2.2.0 = Gauge32: 4294967226 -> Active Calls
.1.3.6.1.4.1.34352.3.1.3.1.3.2.3.0 = Gauge32: 223 -> Error calls
As a result, our graphs make no more sense.
### Troubleshooting
There seems to be a bug causing Total calls to be lower than Error calls when a high number of failed calls are received in a short time window.
Moreover, there is an integer overflow resulting to the negative result of the substraction being converted to a _Gauge32_. Maybe setting it to 0 in case of a negative result would be safer ?
#### Reproduction
Using the following configuration for the snmpstats module of your Kamailio proxy:
```
# -------- snmpstats params -------
modparam("snmpstats", "snmpgetPath", "/usr/bin/")
modparam("snmpstats", "snmpCommunity", "mycommunity")
modparam("snmpstats", "sipEntityType", "proxyServer")
```
On intense peaks of failed calls, get the call success metrics using `snmpwalk` :
`snmpwalk -c mycommunity -v 2c W.X.Y.Z 1.3.6.1.4.1.34352.3.1.3.1.3.2 -O n`
> .1.3.6.1.4.1.34352.3.1.3.1.3.2.1.0 = Gauge32: 153 -> Total Calls
.1.3.6.1.4.1.34352.3.1.3.1.3.2.2.0 = Gauge32: 4294967226 -> Active Calls
.1.3.6.1.4.1.34352.3.1.3.1.3.2.3.0 = Gauge32: 223-> Error calls
### Additional Information
**Kamailio Version**:
`kamailio -v`
> version: kamailio 5.6.4 (x86_64/linux) a004cf
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_ MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_S R_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, U SE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SI ZE 65535, DEFAULT PKG_SIZE 64MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: a004cf
compiled on 16:10:41 May 22 2023 with gcc 4.4.7
* **Operating System**:
`uname -r`
> 2.6.32-279.el6.x86_64
`lsb_release -a`
> LSB Version: :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.3 (Santiago)
Release: 6.3
Codename: Santiago
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4006
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4006(a)github.com>
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [X] Commit message has the format required by CONTRIBUTING guide
- [X] Commits are split per component (core, individual modules, libs, utils, ...)
- [X] Each component has a single commit (if not, squash them into one commit)
- [X] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [X] Small bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [X] PR should be backported to stable branches
- [X] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Python's C interface contract states that C code must *either* raise an exception and return NULL, *or* return a Python object.
Doing both will raise a `SystemError` exception which obscures the original problem. It may also cause a memory leak.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/4044
-- Commit Summary --
* app_python3: fix exception handling
-- File Changes --
M src/modules/app_python3/apy_kemi.c (4)
M src/modules/app_python3s/apy3s_kemi.c (4)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/4044.patchhttps://github.com/kamailio/kamailio/pull/4044.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/4044
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/4044(a)github.com>