[libnice] Any discussion on API to be able to supply ICE credentials (webrtc related)

Stefan Håkansson LK stefan.lk.hakansson at ericsson.com
Tue Mar 10 07:20:09 PDT 2015


On 10/03/15 11:23, Philip Withnall wrote:
> Rohan: Thanks for the patch. I’ve added some review comments on github
> if you would care to take a look at them.
>
> Lorenzo: The NiceCandidate.username and .password are assigned in the
> discovery code (in discovery_add_peer_reflexive_candidate() and
> discovery_learn_remote_peer_reflexive_candidate()), so it won’t work
> after some candidates have been gathered.
>
> If this turns out to be a problem, we can re-jig how credential memory
> management is implemented. However, as I understand Stefan’s request, he
> just needs to be able to set the local credentials before starting the
> ICE session, so that’s OK. I haven’t had time to re-read the spec about
> this though, so please correct me if I’m wrong.

I think you are correct. The issue I have is that an operation called 
"createOffer" in the WebRTC 1.0 specification must produce an SDP offer 
containing ICE credentials, but *not* start any ICE processing (it is 
explicitly said that candidate gathering should not start). Actual 
processing should not start until setLocal (with the offer as argument) 
is called.

A good solution would be to have the credentials settable, then the 
browser can generate credentials when createOffer is called (so they are 
included in the offer generated), and those credentials are set (and 
candidate gathering etc. started) when setLocal is called.

References:

API calls: http://w3c.github.io/webrtc-pc/
SDP details: https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-09 
(section 4.1.2 createOffer says among other things
"   Calling this method may do things such as generate new ICE
    credentials, but does not result in candidate gathering, or cause
    media to start or stop flowing.")

Stefan

>
> Philip
>
> On Tue, 2015-02-24 at 08:31 +0100, Lorenzo Miniero wrote:
>> Would this work after some candidates have already been gathered? I
>> haven't looked in the code, but doesn't each NiceCandidate have its
>> own copy of the credentials as well, which means they should be
>> updated too? Or are they just filled in when you request the local
>> candidates from the application?
>>
>>
>>
>> Lorenzo
>>
>>
>>
>>
>> 2015-02-24 0:30 GMT+01:00 Rohan Garg <rohan16garg at gmail.com>:
>>          Hey everyone
>>          Been quite some time since I last hacked on libnice, but this
>>          looked
>>          like a easy enough task to get back into it, so here's my
>>          patch :
>>          https://github.com/shadeslayer/libnice/compare/set_local_creds.patch
>>
>>          Comes with it's own test as well ;)
>>
>>          Let me know if this will suffice, or if it can do with
>>          improvements.
>>
>>          Cheers
>>          Rohan Garg
>>
>>
>>          On Wed, Feb 18, 2015 at 8:07 AM, Stefan Håkansson LK
>>          <stefan.lk.hakansson at ericsson.com> wrote:
>>          > Hi Olivier,
>>          >
>>          > thanks for the quick reply!
>>          >
>>          > On 17/02/15 16:50, Olivier Crête wrote:
>>          >> Hi,
>>          >>
>>          >> Adding webrtc-friendly features to libnice is definitely
>>          something we
>>          >> care about. But not one is actively working on it. I guess
>>          add a simple
>>          >> nice_agent_set_local_credentials() would be enough for
>>          this?
>>          >
>>          > Yes, to my understanding that would make it.
>>          >
>>          >>
>>          >> Olivier
>>          >>
>>          >> On Tue, 2015-02-17 at 15:13 +0000, Stefan Håkansson LK
>>          wrote:
>>          >>> Hi,
>>          >>>
>>          >>> webrtc/rtcweb (implicitly) requires that it is possible to
>>          supply local
>>          >>> ICE credentials when starting ICE, see
>>          http://rtcweb-wg.github.io/jsep/.
>>          >>>
>>          >>> I say "implicitly" since ICE credentials must be part of
>>          the initial
>>          >>> offer created by createOffer (section 5.2.1), but ICE
>>          processing is not
>>          >>> supposed to happen until a subsequent setLocal happens
>>          which could be
>>          >>> quite a bit later. Also, createOffer is not really
>>          supposed to "do"
>>          >>> anything, things are supposed to start as a result of
>>          setLocal meaning
>>          >>> that ICE processing should not start as a result of
>>          createOffer.
>>          >>>
>>          >>> We're using libnice in our webrtc implementation (which is
>>          based on
>>          >>> gstreamer) https://github.com/EricssonResearch/openwebrtc
>>          and this is an
>>          >>> issue for being standards compliant.
>>          >>>
>>          >>> My question is (obviously): are there any plans for
>>          changing libnice to
>>          >>> enable building webrtc compliant applications?
>>          >>>
>>          >>> Stefan
>>          >>> _______________________________________________
>>          >>> nice mailing list
>>          >>> nice at lists.freedesktop.org
>>          >>> http://lists.freedesktop.org/mailman/listinfo/nice
>>          >>
>>          >
>>          > _______________________________________________
>>          > nice mailing list
>>          > nice at lists.freedesktop.org
>>          > http://lists.freedesktop.org/mailman/listinfo/nice
>>          _______________________________________________
>>          nice mailing list
>>          nice at lists.freedesktop.org
>>          http://lists.freedesktop.org/mailman/listinfo/nice
>>
>>
>>
>> _______________________________________________
>> nice mailing list
>> nice at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/nice
>



More information about the nice mailing list