-
Notifications
You must be signed in to change notification settings - Fork 909
/
params.xml
1422 lines (1363 loc) · 45.3 KB
/
params.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[<!-- Include general documentation entities -->
<!ENTITY % docentities SYSTEM "../../../../doc/docbook/entities.xml">
%docentities;
]
>
<section id="tls.parameters">
<sectioninfo>
</sectioninfo>
<title>Parameters</title>
<section id="tls.p.tls_method">
<title><varname>tls_method</varname> (string)</title>
<para>
Sets the TLS protocol method. Possible values are:
</para>
<itemizedlist>
<listitem>
<para>
<emphasis>TLSv1.3+</emphasis> - TLSv1.3 or newer (TLSv1.3, ...)
connections are accepted (available starting with openssl/libssl v1.1.1)
</para>
</listitem>
<listitem>
<para>
<emphasis>TLSv1.3</emphasis> - only TLSv1.3 connections are accepted
(available starting with openssl/libssl v1.1.1)
</para>
</listitem>
<listitem>
<para>
<emphasis>TLSv1.2+</emphasis> - TLSv1.2 or newer (TLSv1.3, ...)
connections are accepted (available starting with openssl/libssl v1.1.1)
</para>
</listitem>
<listitem>
<para>
<emphasis>TLSv1.2</emphasis> - only TLSv1.2 connections are accepted
(available starting with openssl/libssl v1.0.1e)
</para>
</listitem>
<listitem>
<para>
<emphasis>TLSv1.1+</emphasis> - TLSv1.1 or newer (TLSv1.2, ...)
connections are accepted (available starting with openssl/libssl v1.0.1)
</para>
</listitem>
<listitem>
<para>
<emphasis>TLSv1.1</emphasis> - only TLSv1.1 connections are accepted
(available starting with openssl/libssl v1.0.1)
</para>
</listitem>
<listitem>
<para>
<emphasis>TLSv1+</emphasis> - TLSv1.0 or newer (TLSv1.1, TLSv1.2, ...)
connections are accepted.
</para>
</listitem>
<listitem>
<para>
<emphasis>TLSv1</emphasis> - only TLSv1 (TLSv1.0) connections are
accepted. This is the default value.
</para>
</listitem>
<listitem>
<para>
<emphasis>SSLv3</emphasis> - only SSLv3 connections are accepted.
Note: you shouldn't use SSLv3 for anything which should be secure.
</para>
</listitem>
<listitem>
<para>
<emphasis>SSLv2</emphasis> - only SSLv2 connections, for old clients.
Note: you shouldn't use SSLv2 for anything which should be secure.
Newer versions of OpenSSL libraries don't include support for it anymore.
</para>
</listitem>
<listitem>
<para>
<emphasis>SSLv23</emphasis> - any of the SSLv2, SSLv3 and TLSv1 or
newer methods will be accepted.
</para>
<para>
From the OpenSSL manual: "A TLS/SSL connection established with these
methods may understand the SSLv3, TLSv1, TLSv1.1 and TLSv1.2 protocols.
If extensions are required (for example server name) a client will
send out TLSv1 client hello messages including extensions and will
indicate that it also understands TLSv1.1, TLSv1.2 and permits a
fallback to SSLv3. A server will support SSLv3, TLSv1, TLSv1.1
and TLSv1.2 protocols. This is the best choice when compatibility
is a concern."
</para>
<para>
Note: For older OpenSSL library versions, this option allows SSLv2, with hello
messages done over SSLv2. You shouldn't use SSLv2 or SSLv3 for anything
which should be secure.
</para>
</listitem>
</itemizedlist>
<para>
If RFC 3261 conformance is desired, at least TLSv1 must be used. For
compatibility with older clients SSLv23 is the option, but again, be aware
of security concerns, SSLv2/3 being considered very insecure by 2014.
For current information about what's considered secure, please consult,
IETF BCP 195, currently RFC 7525 - "Recommendations for Secure Use of
Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)"
</para>
<example>
<title>Set <varname>tls_method</varname> parameter</title>
<programlisting>
...
modparam("tls", "tls_method", "TLSv1")
...
</programlisting>
</example>
</section>
<section id="tls.p.certificate">
<title><varname>certificate</varname> (string)</title>
<para>
Sets the certificate file name. The certificate file can also contain
the private key in PEM format.
</para>
<para>
If the file name starts with a '.' the path will be relative to the
working directory (<emphasis>at runtime</emphasis>). If it starts
with a '/' it will be an absolute path and if it starts with anything
else the path will be relative to the main config file directory
(e.g.: for kamailio -f /etc/kamailio/kamailio.cfg it will be relative to /etc/kamailio/).
</para>
<para>
The default value is &kamailioconfdir;/cert.pem
</para>
<example>
<title>Set <varname>certificate</varname> parameter</title>
<programlisting>
...
modparam("tls", "certificate", "/usr/local/etc/kamailio/my_certificate.pem")
...
</programlisting>
</example>
</section>
<section id="tls.p.private_key">
<title><varname>private_key</varname> (string)</title>
<para>
Sets the private key file name. The private key can be in the same
file as the certificate or in a separate file, specified by this
configuration parameter.
</para>
<para>
If the file name starts with a '.' the path will be relative to the
working directory (<emphasis>at runtime</emphasis>). If it starts
with a '/' it will be an absolute path and if it starts with anything
else the path will be relative to the main config file directory
(e.g.: for kamailio -f /etc/kamailio/kamailio.cfg it will be relative to /etc/kamailio/).
</para>
<para>
Note: the private key can be contained in the same file as the
certificate (just append it to the certificate file, e.g.:
cat pkey.pem >> cert.pem)
</para>
<para>
The default value is &kamailioconfdir;/cert.pem
</para>
<example>
<title>Set <varname>private_key</varname> parameter</title>
<programlisting>
...
modparam("tls", "private_key", "/usr/local/etc/kamailio/my_pkey.pem")
...
</programlisting>
</example>
</section>
<section id="tls.p.ca_list">
<title><varname>ca_list</varname> (string)</title>
<para>
Sets the CA list file name. This file contains a list of all the
trusted CAs certificates used when connecting to other SIP implementations.
If a signature in a certificate chain belongs
to one of the listed CAs, the verification of that certificate will succeed.
</para>
<para>
If the file name starts with a '.' the path will be relative to the
working directory (<emphasis>at runtime</emphasis>). If it starts
with a '/' it will be an absolute path and if it starts with anything
else the path will be relative to the main config file directory
(e.g.: for kamailio -f /etc/kamailio/kamailio.cfg it will be relative to /etc/kamailio/).
</para>
<para>
By default the CA file is not set.
</para>
<para>
An easy way to create the CA list is to append each trusted trusted CA
certificate in the PEM format to one file, e.g.:
<programlisting>
for f in trusted_cas/*.pem ; do cat "$f" >> ca_list.pem ; done
</programlisting>
</para>
<para>
See also
<emphasis>verify_certificate</emphasis>,
<emphasis>verify_depth</emphasis>,
<emphasis>require_certificate</emphasis> and
<emphasis>crl</emphasis>.
</para>
<example>
<title>Set <varname>ca_list</varname> parameter</title>
<programlisting>
...
modparam("tls", "ca_list", "/usr/local/etc/kamailio/ca_list.pem")
...
</programlisting>
</example>
</section>
<section id="tls.p.ca_path">
<title><varname>ca_path</varname> (str)</title>
<para>
Sets the path with the trusted CA files, to be given as parameter
SSL_CTX_load_verify_locations(). The certificates in ca_path are only
looked up when required, e.g. when building the certificate chain
or when actually performing the verification of a peer certificate. They
are not given to the client (not loaded to be provided to
SSL_CTX_set_client_CA_list()), only the ones in ca_list files are sent
to the client. It requires to use c_rehash to generate the hash map
for certificate search, for more see the manual of libssl for
SSL_CTX_load_verify_locations() function.
</para>
<para>
By default it is not set.
</para>
<example>
<title>Set <varname>ca_path</varname> parameter</title>
<programlisting>
...
modparam("tls", "ca_path", "/usr/local/etc/kamailio/ca")
...
</programlisting>
</example>
</section>
<section id="tls.p.crl">
<title><varname>crl</varname> (string)</title>
<para>
Sets the certificate revocation list (CRL) file name. This file contains a
list of revoked certificates. Any attempt to verify a revoked
certificate will fail.
</para>
<para>
If not set, no CRL list will be used.
</para>
<para>
If the file name starts with a '.' the path will be relative to the
working directory (<emphasis>at runtime</emphasis>). If it starts
with a '/' it will be an absolute path and if it starts with anything
else the path will be relative to the main config file directory
(e.g.: for kamailio -f /etc/kamailio/kamailio.cfg it will be relative to /etc/kamailio/).
</para>
<note><para>
If set, <varname>require_certificate</varname> should also be set
or it will not have any effect.
</para></note>
<para>
By default the CRL file name is not set.
</para>
<para>
To update the CRL in a running &kamailio;, make sure you configure TLS
via a separate TLS config file
(the <varname>config</varname> modparam) and issue a tls.reload
RPC call, e.g.:
<programlisting>
$ &sercmd; tls.reload
</programlisting>
</para>
<para>
A quick way to create the CRL in PEM format, using OpenSSL is:
<programlisting>
$ openssl ca -gencrl -keyfile cacert.key -cert cacert.pem -out my_crl.pem
</programlisting>
my_crl.pem will contain the signed list of the revoked certificates.
</para>
<para>
To revoke a TLS certificate use something like:
<programlisting>
$ openssl ca -revoke bad_cert.pem -keyfile cacert.key -cert cacert.pem
</programlisting>
and then refresh the crl file using the command above.
</para>
<para>
To display the CRL contents use:
<programlisting>
$ openssl crl -in crl.pem -noout -text
</programlisting>
</para>
<para>
See also
<emphasis>ca_list</emphasis>,
<emphasis>verify_certificate</emphasis>,
<emphasis>verify_depth</emphasis> and
<emphasis>require_certificate</emphasis>.
</para>
<example>
<title>Set <varname>crl</varname> parameter</title>
<programlisting>
...
modparam("tls", "crl", "/usr/local/etc/kamailio/crl.pem")
...
</programlisting>
</example>
</section>
<section id="tls.p.verify_certificate">
<title><varname>verify_certificate</varname> (boolean)</title>
<para>
If enabled it will force certificate verification when connecting to
other SIP servers..
For more information see the
<ulink url="https://www.openssl.org/docs/manmaster/man1/verify.html">verify(1)</ulink>
OpenSSL man page.
</para>
<para>
Note: the certificate verification will always fail if the ca_list is empty.
</para>
<para>
See also: <varname>ca_list</varname>, <varname>require_certificate</varname>, <varname>verify_depth</varname>.
</para>
<para>
By default the certificate verification is off.
</para>
<example>
<title>Set <varname>verify_certificate</varname> parameter</title>
<programlisting>
...
modparam("tls", "verify_certificate", 1)
...
</programlisting>
</example>
</section>
<section id="tls.p.verify_depth">
<title><varname>verify_depth</varname> (integer)</title>
<para>
Sets how far up the certificate chain will the certificate verification go in the search for a trusted CA.
</para>
<para>
See also: <varname>ca_list</varname>, <varname>require_certificate</varname>, <varname>verify_certificate</varname>,
</para>
<para>
The default value is 9.
</para>
<example>
<title>Set <varname>verify_depth</varname> parameter</title>
<programlisting>
...
modparam("tls", "verify_depth", 9)
...
</programlisting>
</example>
</section>
<section id="tls.p.require_certificate">
<title><varname>require_certificate</varname> (boolean)</title>
<para>
When enabled &kamailio; will require a certificate from a client
connecting to the TLS port. If the client does not offer a certificate
and <varname>verify_certificate</varname> is on, certificate verification will fail.
</para>
<para>
The default value is off.
</para>
<example>
<title>Set <varname>require_certificate</varname> parameter</title>
<programlisting>
...
modparam("tls", "require_certificate", 1)
...
</programlisting>
</example>
</section>
<section id="tls.p.cipher_list">
<title><varname>cipher_list</varname> (string)</title>
<para>
Sets the list of accepted ciphers. The list consists of cipher strings separated by colons.
For more information on the cipher list format see the
<ulink url="https://www.openssl.org/docs/manmaster/man1/ciphers.html">
cipher(1)</ulink> OpenSSL man page.
</para>
<para>
The default value is not set (all the OpenSSL supported ciphers are enabled).
</para>
<example>
<title>Set <varname>cipher_list</varname> parameter</title>
<programlisting>
...
modparam("tls", "cipher_list", "HIGH")
...
</programlisting>
</example>
</section>
<section id="tls.p.server_name">
<title><varname>server_name</varname> (string)</title>
<para>
Sets the Server Name Indication (SNI) value.
</para>
<para>
This is a TLS extension enabling one TLS server to serve multiple host
names with unique certificates.
</para>
<para>
The default value is empty (not set).
</para>
<example>
<title>Set <varname>server_name</varname> parameter</title>
<programlisting>
...
modparam("tls", "server_name", "kamailio.org")
...
</programlisting>
</example>
</section>
<section id="tls.p.connection_timeout">
<title><varname>connection_timeout</varname> (int)</title>
<para>
Sets the amount of time after which an idle TLS connection will be
closed, if no I/O ever occurred after the initial open. If an I/O event
occurs, the timeout will be extended with tcp_connection_lifetime.
The value is expressed in seconds.
</para>
<para>
The default value is 10 min.
</para>
<para>
If the value set is -1, the connection will never be close on idle.
</para>
<para>
This setting can be changed also at runtime, via the RPC interface and config
framework. The config variable name is
<emphasis>tls.connection_timeout</emphasis>.
</para>
<example>
<title>Set <varname>connection_timeout</varname> parameter</title>
<programlisting>
...
modparam("tls", "connection_timeout", 60)
...
</programlisting>
</example>
<example>
<title>Set <varname>tls.connection_timeout</varname> at runtime</title>
<programlisting>
$ &sercmd; cfg.set_now_int tls connection_timeout 180
</programlisting>
</example>
</section>
<section id="tls.p.tls_disable_compression">
<title><varname>tls_disable_compression</varname> (boolean)</title>
<para>
If set compression over TLS will be disabled.
Note that compression uses a lot of memory (about 10x more then with
the compression disabled), so if you want to minimize
memory usage is a good idea to disable it. TLS compression also
expose you for the
<ulink url="https://en.wikipedia.org/wiki/CRIME_(security_exploit)">
CRIME</ulink> security vulnerability.
</para>
<para>
By default TLS compression is disabled.
</para>
<example>
<title>Set <varname>tls_disable_compression</varname> parameter</title>
<programlisting>
...
modparam("tls", "tls_disable_compression", 0) # enable
...
</programlisting>
</example>
</section>
<section id="tls.p.ssl_release_buffers">
<title><varname>ssl_release_buffers</varname> (integer)</title>
<para>
Release internal OpenSSL read or write buffers as soon as they are
no longer needed. Combined with
<varname>ssl_freelist_max_len</varname> has the potential of saving
a lot of memory ( ~ 32k per connection in the default configuration,
or 16k + <varname>ssl_max_send_fragment</varname>).
For &kamailio; versions > 3.0 it makes little sense to disable it (0)
since the tls module already has its own internal buffering.
</para>
<para>
A value of -1 would not change this option from its openssl default.
Use 0 or 1 for enable/disable.
</para>
<para>
By default the value is 1 (enabled).
</para>
<note>
<para>
This option is supported only for
OpenSSL versions >= <emphasis>1.0.0</emphasis>.
On all the other versions attempting
to change the default will trigger an error.
</para>
</note>
<example>
<title>Set <varname>ssl_release_buffers</varname> parameter</title>
<programlisting>
modparam("tls", "ssl_release_buffers", 1)
</programlisting>
</example>
</section>
<section id="tls.p.ssl_freelist_max_len">
<title><varname>ssl_freelist_max_len</varname> (integer)</title>
<para>
Sets the maximum number of free memory chunks, that OpenSSL will keep
per connection. Setting it to 0 would cause any unused memory chunk
to be immediately freed, reducing the memory footprint. A too large
value would result in extra memory consumption.
</para>
<para>
Should be combined with <varname>ssl_release_buffers</varname>.
</para>
<para>
A value of -1 has a special meaning: the OpenSSL default will be used
(no attempt on changing the value will be made). For OpenSSL 1.0
the internal default is 32.
</para>
<para>
By default the value is 0 (no freelist).
</para>
<note>
<para>
This option is supported only for
OpenSSL versions >= <emphasis>1.0.0</emphasis>.
On all the other versions attempting
to change the default will trigger an error.
</para>
</note>
<example>
<title>Set <varname>ssl_freelist_max_len</varname> parameter</title>
<programlisting>
modparam("tls", "ssl_freelist_max_len", 0)
</programlisting>
</example>
</section>
<section id="tls.p.ssl_max_send_fragment">
<title><varname>ssl_max_send_fragment</varname> (integer)</title>
<para>
Sets the maximum number of bytes (from the clear text) sent into
one TLS record. Valid values are between 512 and 16384.
Note however that even valid low values might not be big enough to
allow a successful handshake (try minimum 1024).
</para>
<para>
Lower values would lead to less memory usage, but values lower then
the typical &kamailio; write size would incur a slight performance
penalty. Good values are bigger then the size of the biggest
SIP packet one normally expects to forward. For example in most
setups 2048 would be a good value.
</para>
<note>
<para>
Values on the lower side, even if valid (> 512), might not allow
for a successful initial handshake. This happens if the
certificate does not fit inside one send fragment.
Values lower then 1024 should not be used.
Even with higher values, if the handshake fails,
try increasing the value.
</para>
</note>
<para>
A value of -1 has a special meaning: the OpenSSL default will be used
(no attempt on changing the value will be made).
</para>
<para>
By default the value is -1 (the OpenSSL default, which at least in
OpenSSL 1.0.0 is ~ 16k).
</para>
<note>
<para>
This option is supported only for
OpenSSL versions >= <emphasis>0.9.9</emphasis>.
On all the other versions attempting
to change the default will trigger an error.
</para>
</note>
<example>
<title>Set <varname>ssl_max_send_fragment</varname> parameter</title>
<programlisting>
modparam("tls", "ssl_max_send_fragment", 4096)
</programlisting>
</example>
</section>
<section id="tls.p.ssl_read_ahead">
<title><varname>ssl_read_ahead</varname> (boolean)</title>
<para>
Enables read ahead, reducing the number of internal OpenSSL BIO read()
calls. This option has only debugging value, in normal circumstances
it should not be changed from the default.
</para>
<para>
When disabled OpenSSL will make at least 2 BIO read() calls per
received record: one to get the record header and one to get the
rest of the record.
</para>
<para>
The TLS module buffers internally all read()s and defines its own fast
BIO so enabling this option would only cause more memory consumption
and a minor slow-down (extra memcpy).
</para>
<para>
A value of -1 has a special meaning: the OpenSSL default will be used
(no attempt on changing the value will be made).
</para>
<para>
By default the value is 0 (disabled).
</para>
<example>
<title>Set <varname>ssl_read_ahead</varname> parameter</title>
<programlisting>
modparam("tls", "ssl_read_ahead", 1)
</programlisting>
</example>
</section>
<section id="tls.p.send_close_notify">
<title><varname>send_close_notify</varname> (boolean)</title>
<para>
Enables/disables sending close notify alerts prior to closing the
corresponding TCP connection. Sending the close notify prior to TCP
shutdown is "nicer" from a TLS point of view, but it has a measurable
performance impact. Default: off. Can be set at runtime
(tls.send_close_notify).
</para>
<para>
The default value is 0 (off).
</para>
<para>
It can be changed also at runtime, via the RPC interface and config
framework. The config variable name is tls.send_close_notify.
</para>
<example>
<title>Set <varname>send_close_notify</varname> parameter</title>
<programlisting>
...
modparam("tls", "send_close_notify", 1)
...
</programlisting>
</example>
<example>
<title>Set <varname>tls.send_close_notify</varname> at runtime</title>
<programlisting>
$ &sercmd; cfg.set_now_int tls send_close_notify 1
</programlisting>
</example>
</section>
<section id="tls.p.con_ct_wq_max">
<title><varname>con_ct_wq_max</varname> (integer)</title>
<para>
Sets the maximum allowed per connection clear-text send queue size in
bytes. This queue is used when data cannot be encrypted and sent
immediately because of an ongoing TLS level renegotiation.
</para>
<para>
The default value is 65536 (64 Kb).
</para>
<para>
It can be changed also at runtime, via the RPC interface and config
framework. The config variable name is tls.con_ct_wq_max.
</para>
<example>
<title>Set <varname>con_ct_wq_max</varname> parameter</title>
<programlisting>
...
modparam("tls", "con_ct_wq_max", 1048576)
...
</programlisting>
</example>
<example>
<title>Set <varname>tls.con_ct_wq_max</varname> at runtime</title>
<programlisting>
$ &sercmd; cfg.set_now_int tls con_ct_wq_max 1048576
</programlisting>
</example>
</section>
<section id="tls.p.ct_wq_max">
<title><varname>ct_wq_max</varname> (integer)</title>
<para>
Sets the maximum total number of bytes queued in all the clear-text
send queues. These queues are used when data cannot be encrypted and
sent immediately because of an ongoing TLS level renegotiation.
</para>
<para>
The default value is 10485760 (10 Mb).
</para>
<para>
It can be changed also at runtime, via the RPC interface and config
framework. The config variable name is <varname>tls.ct_wq_max</varname>.
</para>
<example>
<title>Set <varname>ct_wq_max</varname> parameter</title>
<programlisting>
...
modparam("tls", "ct_wq_max", 4194304)
...
</programlisting>
</example>
<example>
<title>Set <varname>tls.ct_wq_max</varname> at runtime</title>
<programlisting>
$ &sercmd; cfg.set_now_int tls ct_wq_max 4194304
</programlisting>
</example>
</section>
<section id="tls.p.ct_wq_blk_size">
<title><varname>ct_wq_blk_size</varname> (integer)</title>
<para>
Minimum block size for the internal clear-text send queues
(debugging / advanced tuning).
Good values are multiple of typical datagram sizes.
</para>
<para>
The default value is 4096.
</para>
<para>
It can be changed also at runtime, via the RPC interface and config
framework. The config variable name is <varname>tls.ct_wq_blk_size</varname>.
</para>
<example>
<title>Set <varname>ct_wq_blk_size</varname> parameter</title>
<programlisting>
...
modparam("tls", "ct_wq_blk_size", 2048)
...
</programlisting>
</example>
<example>
<title>Set <varname>tls.ct_wq_max</varname> at runtime</title>
<programlisting>
$ &sercmd; cfg.set_now_int tls ct_wq_blk_size 2048
</programlisting>
</example>
</section>
<section id="tls.p.tls_log">
<title><varname>tls_log</varname> (int)</title>
<para>
Sets the log level at which TLS related messages will be logged.
</para>
<para>
The default value is 3 (L_DBG).
</para>
<para>
It can be changed also at runtime, via the RPC interface and config
framework. The config variable name is <varname>tls.log</varname>.
</para>
<example>
<title>Set <varname>tls_log</varname> parameter</title>
<programlisting>
...
# ignore TLS messages if Kamailio is started with debug less than 10
modparam("tls", "tls_log", 10)
...
</programlisting>
</example>
<example>
<title>Set <varname>tls.log</varname> at runtime</title>
<programlisting>
$ &sercmd; cfg.set_now_int tls log 10
</programlisting>
</example>
</section>
<section id="tls.p.tls_debug">
<title><varname>tls_debug</varname> (int)</title>
<para>
Sets the log level at which TLS debug messages will be logged.
Note that TLS debug messages are enabled only if the TLS module
is compiled with debugging enabled (e.g. -DTLS_WR_DEBUG,
-DTLS_RD_DEBUG or -DTLS_BIO_DEBUG).
</para>
<para>
The default value is 3 (L_DBG).
</para>
<para>
It can be changed also at runtime, via the RPC interface and config
framework. The config variable name is <varname>tls.debug</varname>.
</para>
<example>
<title>Set <varname>tls_debug</varname> parameter</title>
<programlisting>
...
# ignore TLS debug messages if Kamailio is started with debug less than 10
modparam("tls", "tls_debug", 10)
...
</programlisting>
</example>
<example>
<title>Set <varname>tls.debug</varname> at runtime</title>
<programlisting>
$ &sercmd; cfg.set_now_int tls debug 10
</programlisting>
</example>
</section>
<section id="tls.p.low_mem_threshold1">
<title><varname>low_mem_threshold1</varname> (integer)</title>
<para>
Sets the minimal free memory from which attempts to open or accept
new TLS connections will start to fail. The value is expressed in KB.
</para>
<para>
The default value depends on whether the OpenSSL library used handles
low memory situations in a good way (openssl bug #1491).
As of this writing this is not true for any OpenSSL version (including 0.9.8e).
</para>
<para>
If an ill-behaved OpenSSL version is detected, a very conservative value is chosen,
which depends on the maximum possible number of simultaneously created TLS connections
(and hence on the process number).
</para>
<para>
The following values have a special meaning:
</para>
<itemizedlist>
<listitem>
<para>
-1 - use the default value
</para>
</listitem>
<listitem>
<para>
0 - disable (TLS connections will not fail preemptively)
</para>
</listitem>
</itemizedlist>
<para>
It can be changed also at runtime, via the RPC interface and config
framework. The config variable name is <varname>tls.low_mem_threshold1</varname>.
</para>
<para>
See also <varname>tls.low_mem_threshold2</varname>.
</para>
<example>
<title>Set <varname>low_mem_threshold1</varname> parameter</title>
<programlisting>
...
modparam("tls", "low_mem_threshold1", -1)
...
</programlisting>
</example>
<example>
<title>Set <varname>tls.low_mem_threshold1</varname> at runtime</title>
<programlisting>
$ &sercmd; cfg.set_now_int tls low_mem_threshold1 2048
</programlisting>
</example>
</section>
<section id="tls.p.low_mem_threshold2">
<title><varname>low_mem_threshold2</varname> (integer)</title>
<para>
Sets the minimal free memory from which TLS operations on already established
TLS connections will start to fail preemptively. The value is expressed in KB.
</para>
<para>
The default value depends on whether the OpenSSL library used handles low memory
situations (openssl bug #1491).
As of this writing this is not true for any OpenSSL version (including 0.9.8e).
</para>
<para>
If an ill-behaved OpenSSL version is detected, a very conservative value is chosen,
which depends on the maximum possible number of simultaneously created
TLS connections (and hence on the process number).
</para>
<para>
The following values have a special meaning:
</para>
<itemizedlist>
<listitem>
<para>
-1 - use the default value
</para>
</listitem>
<listitem>
<para>
0 - disable (TLS operations will not fail preemptively)
</para>
</listitem>
</itemizedlist>
<para>
It can be changed also at runtime, via the RPC interface and config
framework. The config variable name is <varname>tls.low_mem_threshold2</varname>.
</para>
<para>
See also <varname>tls.low_mem_threshold1</varname>.
</para>
<example>
<title>Set <varname>tls.low_mem_threshold2</varname> parameter</title>
<programlisting>
...
modparam("tls", "low_mem_threshold2", -1)
...
</programlisting>
</example>
<example>
<title>Set <varname>tls.low_mem_threshold2</varname> at runtime</title>
<programlisting>
$ &sercmd; cfg.set_now_int tls low_mem_threshold2 1024
</programlisting>
</example>
</section>
<section id="tls.p.tls_force_run">
<title><varname>tls_force_run</varname> (boolean)</title>
<para>
If enabled &kamailio; will start even if some of the OpenSSL sanity checks fail (turn it on at your own risk).
</para>
<para>
If any of the following sanity checks fail, Kamailio will not start:
</para>
<itemizedlist>
<listitem>
<para>
the version of the library the TLS module was compiled with is
"too different" from the library used at runtime. The versions should have the same major,
minor and fix level (e.g.: 0.9.8a and 0.9.8c are ok, but 0.9.8 and 0.9.9 are not)
</para>
</listitem>
<listitem>
<para>
the OpenSSL library used at compile time and the one used at
runtime have different Kerberos options
</para>
</listitem>
</itemizedlist>
<para>
By default tls_force_run is disabled.
</para>
<example>
<title>Set <varname>tls_force_run</varname> parameter</title>
<programlisting>
...
modparam("tls", "tls_force_run", 11)
...
</programlisting>
</example>
</section>
<section id="tls.p.session_cache">
<title><varname>session_cache</varname> (boolean)</title>
<para>
If enabled &kamailio; will do caching of the TLS sessions data,
generation a session_id and sending it back to client.
</para>
<para>
By default TLS session caching is disabled (0).
</para>
<example>
<title>Set <varname>session_cache</varname> parameter</title>
<programlisting>
...
modparam("tls", "session_cache", 1)
...
</programlisting>
</example>
</section>
<section id="tls.p.session_id">
<title><varname>session_id</varname> (str)</title>
<para>
The value for session ID context, making sense when session caching is enabled.