Skip to content

Commit

Permalink
tls: historical code comment on repeating SSL_CTX per worker
Browse files Browse the repository at this point in the history
(cherry-pick from 29007ad)
  • Loading branch information
space88man committed Jan 11, 2024
1 parent 1eb1d50 commit c5ed0e6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/modules/tls/tls_mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,16 @@ static int tls_engine_init();
int tls_fix_engine_keys(tls_domains_cfg_t *, tls_domain_t *, tls_domain_t *);
#endif

/*
* OpenSSL 1.1.1+: SSL_CTX is repeated in each worker
*
* OpenSSL RSA blinding works in single-process multi-threaded mode
* and depends on pthread_self() to separate threads. In Kamailio multi-process workers
* pthread_self() will not necessarily be unique, this will result in incorrect BN
* operations—hence we create a separate SSL_CTX for each worker
*
* EC operations do not use pthread_self(), so could use shared SSL_CTX
*/
static int mod_child(int rank)
{
if(tls_disable || (tls_domains_cfg == 0))
Expand Down

0 comments on commit c5ed0e6

Please sign in to comment.