testing_and_debugging_tls_connections
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
testing_and_debugging_tls_connections [2012/07/13 07:07] – created klaus3000 | testing_and_debugging_tls_connections [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Testing and Debugging TLS Connections ====== | ||
- | |||
- | ===== Test TLS Connections with a Web Browser ===== | ||
- | |||
- | |||
- | Testing TLS connections is sometimes a bit tricky. You have to find a SIP client which supports TLS, and then if there are problems, you often do not know if the problem is caused by the SIP client or the SIP server. | ||
- | |||
- | When using Kamailio as SIP proxy it is very easy to test TLS connections by using a web browser and configure Kamailio to accept HTTP(S) connections too. Just add the following config snippets to kamailio.cfg and restart Kamailio: | ||
- | |||
- | < | ||
- | # to allow HTTP requests | ||
- | tcp_accept_no_cl=yes | ||
- | |||
- | . | ||
- | . | ||
- | . | ||
- | |||
- | # load web server module | ||
- | loadmodule " | ||
- | |||
- | . | ||
- | . | ||
- | . | ||
- | |||
- | # xhttp event route | ||
- | event_route[xhttp: | ||
- | xhttp_reply(" | ||
- | } | ||
- | </ | ||
- | |||
- | Then point your browser to Kamailio and check if the configuration works: | ||
- | - Try plain TCP (HTTP) connections: | ||
- | - If TCP works, try TLS (HTTPS) connections: | ||
- | |||
- | If the browser complains about invalid certificates, | ||
- | |||
- | ===== Debugging TLS Connections ===== | ||
- | |||
- | On the server side you can use the " | ||
- | |||
- | For example this is the ssldump trace from a failing handshake between Kamailio 3.3 and Eyebeam 1.5: | ||
- | |||
- | < | ||
- | New TCP connection #1: pc177.example.com(51642) <-> sip.example.com(5061) | ||
- | 1 1 0.0009 (0.0009) | ||
- | ClientHello | ||
- | Version 3.1 | ||
- | cipher suites | ||
- | TLS_DHE_RSA_WITH_AES_256_CBC_SHA | ||
- | TLS_RSA_WITH_AES_256_CBC_SHA | ||
- | TLS_DHE_DSS_WITH_AES_256_CBC_SHA | ||
- | compression methods | ||
- | NULL | ||
- | 1 2 0.0022 (0.0012) | ||
- | ServerHello | ||
- | Version 3.1 | ||
- | session_id[0]= | ||
- | |||
- | cipherSuite | ||
- | compressionMethod | ||
- | 1 3 0.0022 (0.0000) | ||
- | Certificate | ||
- | 1 4 0.0022 (0.0000) | ||
- | ServerHelloDone | ||
- | 1 5 0.0038 (0.0016) | ||
- | level fatal | ||
- | value | ||
- | 1 0.0044 (0.0005) | ||
- | </ | ||
- | |||
- | Above trace clearly shows that the client closes the TLS/TCP connection due to " | ||
- | |||
- | < | ||
- | New TCP connection #1: pc177.example.com(51733) <-> sip.example.com(5061) | ||
- | 1 1 0.0009 (0.0009) | ||
- | ClientHello | ||
- | Version 3.1 | ||
- | cipher suites | ||
- | TLS_DHE_RSA_WITH_AES_256_CBC_SHA | ||
- | TLS_RSA_WITH_AES_256_CBC_SHA | ||
- | TLS_DHE_DSS_WITH_AES_256_CBC_SHA | ||
- | compression methods | ||
- | NULL | ||
- | 1 2 0.0024 (0.0015) | ||
- | ServerHello | ||
- | Version 3.1 | ||
- | session_id[0]= | ||
- | |||
- | cipherSuite | ||
- | compressionMethod | ||
- | 1 3 0.0024 (0.0000) | ||
- | Certificate | ||
- | 1 4 0.0024 (0.0000) | ||
- | ServerHelloDone | ||
- | 1 5 0.0118 (0.0093) | ||
- | ClientKeyExchange | ||
- | 1 6 0.0118 (0.0000) | ||
- | 1 7 0.0118 (0.0000) | ||
- | 1 8 0.0311 (0.0193) | ||
- | 1 9 0.0311 (0.0000) | ||
- | 1 10 0.0433 (0.0121) | ||
- | 1 11 0.0433 (0.0000) | ||
- | 1 12 0.1175 (0.0741) | ||
- | 1 13 0.1185 (0.0010) | ||
- | </ | ||
- | |||
- | On the client side it is handy to use Wireshark to capture the SIPS traffic via connections attempts. Then verify the handshake to find out which party closes the connection. Wireshark is also handy to inspect the certificates exchanged in the TLS handshake, e.g. if the server also provided the proper server certificate and intermediate certificates. | ||
- | |||
- | ===== Decoding of TLS Connections with Wireshark ===== | ||
- | |||
- | Wireshark can be used to decode SSL/TLS sessions. To decode SSL/TLS connections, | ||
- | * The private key of the TLS server is known (maybe both keys are needed if mutual TLS (=client certificate) is used?) | ||
- | * The TLS connections does not use a Diffie-Hellman cipher | ||
- | * Wireshark captures the TLS session from the beginning (including the TLS handshake) | ||
- | |||
- | To decode TLS connections configure Wireshark and Kamailio: | ||
- | * Copy the server' | ||
- | * Edit → Preferences → Protocols → SSL → RSA Keys List: e.g.: // | ||
- | * If the server uses Diffie-Hellman (DH) Ciphers (depends on default compile time settings of libssl) you have to configure Kamailio to use other ciphers. See: | ||
- | * http:// | ||
- | * http:// | ||
- | * To make sure you capture the TLS handshake | ||
- | * Close the SIP client | ||
- | * Start Wireshark and start capturing | ||
- | * Start the SIP client. | ||
- | |||
- | If you have problems decoding the TLS session you should enable debugging in Wireshark: Edit -> Preferences -> Protocols -> SSL -> SSL Debug File | ||
- | |||
- | ===== TLS Clients ===== | ||
- | |||
- | Following a list of TLS clients and the certificate store they use (please extend): | ||
- | * Eyebeam Windows: Windows certificate store | ||
- | * QjSimple: select CA file in configuration dialog | ||
- | * Internet Explorer: Windows certificate store | ||
- | * Chrome: Windows certificate store | ||
- | * Firefox: Dedicated Firefox certificate store | ||
testing_and_debugging_tls_connections.1342163244.txt.gz · Last modified: 2012/07/13 07:07 by klaus3000