siptls.txt 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. Asterisk SIP/TLS Transport
  2. ==========================
  3. When using TLS the client will typically check the validity of the
  4. certificate chain. So that means you either need a certificate that is
  5. signed by one of the larger CAs, or if you use a self signed certificate
  6. you must install a copy of your CA certificate on the client.
  7. So far this code has been test with:
  8. - Asterisk as client and server (TLS and TCP)
  9. - Polycom Soundpoint IP Phones (TLS and TCP)
  10. Polycom phones require that the host (ip or hostname) that is
  11. configured match the 'common name' in the certificate
  12. - Minisip Softphone (TLS and TCP)
  13. - Cisco IOS Gateways (TCP only)
  14. - SNOM 360 (TLS only)
  15. - Zoiper Biz Softphone (TLS and TCP)
  16. sip.conf options
  17. ----------------
  18. tlsenable=[yes|no]
  19. Enable TLS server, default is no
  20. tlsbindaddr=<ip address>
  21. Specify IP address to bind TLS server to, default is 0.0.0.0
  22. tlscertfile=</path/to/certificate>
  23. The server's certificate file. Should include the key and
  24. certificate. This is mandatory if your going to run a TLS server.
  25. tlscafile=</path/to/certificate>
  26. If the server your connecting to uses a self signed certificate
  27. you should have their certificate installed here so the code can
  28. verify the authenticity of their certificate.
  29. tlscadir=</path/to/ca/dir>
  30. A directory full of CA certificates. The files must be named with
  31. the CA subject name hash value.
  32. (see man SSL_CTX_load_verify_locations for more info)
  33. tlsdontverifyserver=[yes|no]
  34. If set to yes, don't verify the servers certificate when acting as
  35. a client. If you don't have the server's CA certificate you can
  36. set this and it will connect without requiring tlscafile to be set.
  37. Default is no.
  38. tlscipher=<SSL cipher string>
  39. A string specifying which SSL ciphers to use or not use
  40. A list of valid SSL cipher strings can be found at:
  41. http://www.openssl.org/docs/apps/ciphers.html#CIPHER_STRINGS
  42. Sample config
  43. -------------
  44. Here are the relevant bits of config for setting up TLS between 2
  45. asterisk servers. With server_a registering to server_b
  46. On server_a:
  47. [general]
  48. tlsenable=yes
  49. tlscertfile=/etc/asterisk/asterisk.pem
  50. tlscafile=/etc/ssl/ca.pem ; This is the CA file used to generate both certificates
  51. register => tls://100:test@192.168.0.100:5061
  52. [101]
  53. type=friend
  54. context=internal
  55. host=192.168.0.100 ; The host should be either IP or hostname and should
  56. ; match the 'common name' field in the servers certificate
  57. secret=test
  58. dtmfmode=rfc2833
  59. disallow=all
  60. allow=ulaw
  61. transport=tls
  62. port=5061
  63. On server_b:
  64. [general]
  65. tlsenable=yes
  66. tlscertfile=/etc/asterisk/asterisk.pem
  67. [100]
  68. type=friend
  69. context=internal
  70. host=dynamic
  71. secret=test
  72. dtmfmode=rfc2833
  73. disallow=all
  74. allow=ulaw
  75. ;You can specify transport= and port=5061 for TLS, but its not necessary in
  76. ;the server configuration, any type of SIP transport will work
  77. ;transport=tls
  78. ;port=5061