Search code examples
firefoxwebrtcsdp

Firefox doesn't init tls session


What I want: Connect with browser by WebRTC.

What I have: Works in Chrome but not in Firefox (v69).

What I do:

Send offer sdp:

v=0
o=- 45635473 45635473 IN IP4 192.168.45.107
s=-
t=0 0
a=sendrecv
a=group:BUNDLE audio
a=msid-semantic:WMS *
m=audio 22790 UDP/TLS/RTP/SAVPF 8
c=IN IP4 192.168.100.249
a=candidate:2222216195 1 udp 2113937151 192.168.100.249 22790 typ host generation 0 network-cost 999
a=sendrecv
a=end-of-candidates
a=fingerprint:sha-256 12:60:3D:50:84:16:E7:CE:48:92:C2:69:FC:6B:7C:7F:5C:BA:38:9F:B4:01:C0:D9:7A:25:46:AA:78:1B:7A:C1
a=ice-options:trickle
a=ice-pwd:dqiAkA7gz+KCbmB8Fvqx/I6K
a=ice-ufrag:5555
a=mid:audio
a=ptime:20
a=rtcp:22790 IN IP4 192.168.100.249
a=rtcp-mux
a=rtpmap:8 PCMA/8000
a=setup:actpass
a=ssrc:305419896 cname:{9f920404-13ea-41d3-a713-dd7d5a2a3f8c}
a=ssrc:305419896 msid:{7c832778-1f71-4a78-ac13-2128307e7505} {105c1d78-bbf9-4ad4-a5fa-13e298818389}

Get answer sdp:

v=0
o=mozilla...THIS_IS_SDPARTA-70.0 4210281848269721021 0 IN IP4 0.0.0.0
s=-
t=0 0
a=fingerprint:sha-256 57:EF:92:15:61:E1:88:F4:D8:6C:92:C0:83:E1:A6:1D:72:40:94:CC:FC:22:35:D6:A1:DE:90:66:87:2A:3B:36
a=group:BUNDLE audio
a=ice-options:trickle
a=msid-semantic:WMS *
m=audio 9 UDP/TLS/RTP/SAVPF 8
c=IN IP4 0.0.0.0
a=sendrecv
a=ice-pwd:5982b9957048e05908f949e516627a62
a=ice-ufrag:56d206b1
a=mid:audio
a=msid:{6a68b1cb-a051-4183-be60-f4294b5aff3e} {954d21c7-c148-4083-b14b-e38bf53cebce}
a=rtcp-mux
a=rtpmap:8 PCMA/8000
a=setup:active
a=ssrc:1350429253 cname:{e4ad1fde-1111-4882-8b16-55155c461ba9}

At about:webrtc page I have some logs (It is fragment of these):

ICE-PEER(PC:1570470352934806 (id=105226698753 url=https://192.168.100.249/):default)/CAND-PAIR(xnNi): setting pair to state SUCCEEDED: xnNi|IP4:192.168.100.249:22790/UDP|IP4:192.168.100.249:22790/UDP(prflx|candidate:2222216195 1 udp 2113937151 192.168.100.249 22790 typ host generation 0 network-cost 999)

ICE-PEER(PC:1570470352934806 (id=105226698753 url=https://192.168.100.249/):default): no FROZEN/WAITING pairs for PC:1570470352934806 (id=105226698753 url=https://192.168.100.249/) transport-id=transport_0 - 56d206b1:5982b9957048e05908f949e516627a62

ICE(PC:1570470352934806 (id=105226698753 url=https://192.168.100.249/)): peer (PC:1570470352934806 (id=105226698753 url=https://192.168.100.249/):default) Trickle grace period is over; marking every component with only failed pairs as failed.

+++++++ END ++++++++

So, I got STUN request but not DTLS after it.

|           Remote candidate          |  ICE State  |  Nominated  |  Selected   |

|    192.168.100.249:22790/udp(host)  |  succeeded  |    false    |    false    |

Solution

  • Didn't catch it when I initially looked at your ICE table, but in your example above ICE had not yet finished. You have a success state, but Nominated and Selected should be true and not false. My guess would be that your endpoint is the ICE controller and hasn't send the use-candidate attribute yet. So Firefox still waits for your endpoint to say which ICE candidate pair to use, before it can send the DTLS hello over the chosen connection.