DTLS alert when receiving DTLS Client Hello
Reported by
teih...@gmail.com,
Jun 14 2016
|
|||||
Issue descriptionUserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.33 Safari/537.36 Example URL: Steps to reproduce the problem: 1. Make webrtc connection to my Gateway (OpenSSL 1.0.1e) 2. After ICE negotiation dtls connection starts 3. Chrome received "Client hello" DTLS message frome the Gateway 4. DTLS failed What is the expected behavior? DTLS should setup successfully. What went wrong? Chrome responds with Alert (Level: Fatal, Description: Handshake Failure) In chrome log there are following lines [47588:49376:0614/122150:INFO:opensslstreamadapter.cc(749)] BeginSSL: with peer [47588:49376:0614/122150:VERBOSE1:opensslstreamadapter.cc(803)] ContinueSSL [47588:49376:0614/122150:VERBOSE1:opensslstreamadapter.cc(826)] -- error want read [47588:49376:0614/122150:INFO:dtlstransportchannel.cc(587)] Jingle:Channel[audio|1|__]: DtlsTransportChannelWrapper: Started DTLS handshake [47588:49376:0614/122150:VERBOSE1:transportchannel.cc(51)] Jingle:Channel[audio|1|__]: set_dtls_state from:0 to 1 [47588:49376:0614/122150:INFO:srtpfilter.cc(438)] SRTP reset to init state [47588:49376:0614/122150:VERBOSE1:dtlstransportchannel.cc(455)] Jingle:Channel[audio|1|__]: DTLSTransportChannelWrapper: channel receiving state changed to 1 [47588:49376:0614/122150:INFO:basicportallocator.cc(694)] All candidates gathered for audio:1:0 [47588:49376:0614/122150:INFO:p2ptransportchannel.cc(556)] P2PTransportChannel: audio, component 1 gathering complete [47588:49376:0614/122150:VERBOSE1:port.cc(1061)] Jingle:Conn[0000000005DBA870:audio:6y7MJccc:1:0:local:udp:192.168.225.x:64672->fk16QzBn:1:2130706431:local:udp:31.186.102.x:5070|CRWS|9114756780671369214|2261]: UpdateState(), ms since last received response=1, ms since last received data=3024063194, rtt=3000, pings_since_last_response= [47588:49376:0614/122150:VERBOSE1:port.cc(1061)] Jingle:Conn[00000000041207A0:audio:YVgWq2j6:1:0:local:udp:192.168.152.x:64673->fk16QzBn:1:2130706431:local:udp:31.186.102.x:5070|C--W|9114475305694658558|-]: UpdateState(), ms since last received response=3024063194, ms since last received data=3024063194, rtt=3000, pings_since_last_response= [47588:49376:0614/122150:VERBOSE1:port.cc(1061)] Jingle:Conn[0000000005D36670:audio:X2P/ohdy:1:0:local:udp:192.168.78.x:64674->fk16QzBn:1:2130706431:local:udp:31.186.102.x:5070|C--W|9114193830717947902|-]: UpdateState(), ms since last received response=3024063194, ms since last received data=3024063194, rtt=3000, pings_since_last_response= [47588:49376:0614/122150:VERBOSE1:opensslstreamadapter.cc(691)] OpenSSLStreamAdapter::OnEvent SE_READ [47588:49376:0614/122150:VERBOSE1:opensslstreamadapter.cc(803)] ContinueSSL [47588:49376:0614/122150:VERBOSE1:opensslstreamadapter.cc(842)] -- error -1 [47588:49376:0614/122150:WARNING:opensslstreamadapter.cc(850)] OpenSSLStreamAdapter::Error(ContinueSSL, 1) [47588:49376:0614/122150:INFO:opensslstreamadapter.cc(860)] Cleanup [47588:49376:0614/122150:WARNING:opensslstreamadapter.cc(870)] SSL_shutdown failed, error = 1 [47588:49376:0614/122150:INFO:dtlstransportchannel.cc(574)] Jingle:Channel[audio|1|__]: DTLS channel error, code=1 [47588:49376:0614/122150:VERBOSE1:transportchannel.cc(51)] Jingle:Channel[audio|1|__]: set_dtls_state from:1 to 4 [47588:49376:0614/122150:INFO:srtpfilter.cc(438)] SRTP reset to init state And OpenSSL writes to log error:14102410:SSL routines:DTLS1_READ_BYTES:sslv3 alert handshake failure Did this work before? N/A Is it a problem with Flash or HTML5? HTML5 Does this work in other browsers? N/A Chrome version: 52.0.2743.33 Channel: beta OS Version: 6.1 (Windows 7, Windows Server 2008 R2) Flash Version: Shockwave Flash 22.0 r0 Also this error firstly appeared on one machines in chrome stable 51.0.2704.79 m on 6th june 2016, but after update to stable 51.0.2704.84 m error disappeared on the same machine. It's not reproducible on different machines, but if problem appears on one machine, then it become totally reproducible on this machine.
,
Jun 14 2016
In firefox nightly (49.0a1 и 50.0a1) everything works as expected on machine with above-mentioned problem.
,
Jun 21 2016
after update 52.0.2743.41 beta-m (64-bit) yhe issue still exist
,
Jun 29 2016
,
Jul 11 2016
pthatcher, can you help with an owner?
,
Jul 18 2016
,
Jul 25 2016
Our customer faced with this issue in Chrome version 52.0.2743.82 m. Is there any chance to speed this up?
,
Jul 25 2016
The symptoms you describe (inconsistent repro across machines, consistent on one machine) suggest this behavior might be triggered by a Chrome experiment to make ECDSA certificates the default for WebRTC. We've seen a similar issue here: https://bugs.chromium.org/p/webrtc/issues/detail?id=5863. On an affected machine, try going to chrome://flags/#enable-webrtc-ecdsa and choosing "Disabled". Let us know if that stops the problem from occurring. As for why TLS negotiation is failing with an ECDSA certificate, a network capture (e.g. Wireshark) would be useful. Previously, for example, we've seen servers that advertise ECDH but are only partially configured for it, so we try to fall back to kDHE+aECDSA, which we don't actually support.
,
Jul 26 2016
Thank you, I've tested this solution on 2 affected machines and the problem is solved in both cases! So, these issues are really about one thing and should be merged.
,
Jul 26 2016
The issue in https://bugs.chromium.org/p/webrtc/issues/detail?id=5863 was that the WebRTC peer had a noncompliant implementation of DTLS. The solution was a fix in the server software, rather than a fix in Chrome. Have you concluded the bug here is also in your server? If so, great. Otherwise, we'll need a network capture of the DTLS handshake in order to continue the investigation.
,
Jul 26 2016
Am I right that in future releases ECDSA will be set in "Enabled" state and I should update my Gateway to work with such certificates?
,
Jul 26 2016
Oh, I didn't mention your comment, sorry, I'll check dump.
,
Jul 26 2016
Yes, Chrome -- and WebRTC in general -- are planning on moving to ECDSA certificates by default. If you need to interoperate with peers that only support RSA, you can change your Javascript client code to create RSA certificates explicitly. See http://w3c.github.io/webrtc-pc/#sec.cert-mgmt.
,
Jul 26 2016
I set enable-webrtc-ecdsa to "Enabled" and after Chrome restart I see the strange behaviour: with one server dtls setup finished successfully and with other server dtls setup finished with failure. Recently I thought that problem should be persistent on both servers, because there is same Gateway software and same browser. So I make pcap file with successfull and failed dtls setup (I omited some packets, because I think they are not nessassary).
,
Jul 26 2016
Yep, this is consistent with what we saw in https://bugs.chromium.org/p/webrtc/issues/detail?id=5863. Specifically, the DTLS ClientHello (e.g. packet 3 in the attachment in #15) advertises support for EC key agreement protocols like TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, but since it doesn't include the elliptic_curves extension (https://tools.ietf.org/html/rfc4492#section-5.1.1), BoringSSL rejects those ECDH ciphers. If there are inconsistencies here, it may be because the client/server roles switch. This problem will only occur if Chrome is acting as the server in DTLS.
,
Jul 27 2016
Yes, thank you, I see it now! Also I see some kind of "magic" in my setup. I have same versions of my Gateway on 130.167.246.139 and 255.171.130.2 (so the code working with OpenSSL is same too), also I have same version of OpenSSL - 1.0.1e. Also I have one chrome browser calling both gateways in the same way (so there is no role switching). And now I can't figure out why they produce different "Client Hello" messages: the first one contains ECDSA and eliptic_curves extensions and the second one doesn't. Maybe there is some system wide config or something else? May be you have some ideas, because I'm totally stuck:(
,
Jul 27 2016
Any chance one or both of the gateways is behind a load balancer or reverse proxy? For curiosity's sake, here's the fix to OpenSSL that started adding these extensions in the ClientHello for DTLS 1.0: https://github.com/openssl/openssl/commit/2054eb771ea29378f90d3a77c2f4015b17de702d It was first included in OpenSSL 1.0.1i: https://github.com/openssl/openssl/compare/OpenSSL_1_0_1h...OpenSSL_1_0_1i Since we've established this is a bug with the gateway (admittedly exacerbated by conservative behavior in BoringSSL), I'm going to close this as WontFix.
,
Jul 27 2016
,
Jul 28 2016
I'll do more investigatesions, thank you for your time and patience.
,
Jul 29 2016
May be it will help somebody else: Inspite of the same version of openssl (which is determined from command "openssl version") there were different openssl packages on machines: 1) On problem machine openssl* 1.0.1e-16.el6_5.7 2) On good machine openssl* 1.0.1e-48.el6_8.1 So, after update to 1.0.1e-48.el6_8.1 problem machine start sending good "Client Hello" messages with full set of nessessary headers.
,
Jul 29 2016
Thanks for circling back with details! Glad you were able to fix your setup. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by teih...@gmail.com
, Jun 14 2016