Bugs item #1465023, was opened at 2006-04-05 23:22
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=756076&aid=1465023&group_id=143636

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Roland Kay (rkay)
Assigned to: Nobody/Anonymous (nobody)
Summary: Have to pass both TPTAG_CERTIFICATE to enable TLS.

Initial Comment:
In 1.11.7 it appears necessary to pass  
TPTAG_CERTIFICATE instead of NUTAG_CERTIFICATE_DIR to
nua_create() if certificates are not stored in "~/.sip".

This works:

app_ctx->nua = nua_create(app_ctx->root,
                          nua_event_handler,
                          NUTAG_SIPS_URL("sips:*"),
                          TPTAG_CERTIFICATE(certs),
                          TAG_NULL());

whereas this does not:

app_ctx->nua = nua_create(app_ctx->root,
                          nua_event_handler,
                          NUTAG_SIPS_URL("sips:*"),
                          NUTAG_CERTIFICATE(certs),
                          TAG_NULL());

As to the cause, there appears to be some confusion in
nua_stack_init():

nua->nua_nta = nta_agent_create(root, NONE, NULL, NULL,
                     TPTAG_CERTIFICATE(certificate_dir)
                     NTATAG_TAG_3261(0),
                     TAG_NEXT(nua->nua_args));

Converts the NUTAG_CERTIFICATE_DIR to
TPTAG_CERTIFICATE, but as far as I can see
nta_agent_create() ignores this tag.

Subsequently, the call to nta_agent_add_tport() passes
in nua->nua_tags and so passing TPTAG_CERTIFICATE to
nua_create() works around the problem.

I assume that what is supposed to happen is that either
  a) nta_agent_create() should process
TPTAG_CERTIFICATE and add this to future calls to
nta_agent_add_tport() if TLS is involved 

  or

  b) nua_stack_init should pass the TPTAG_CERTIFICATE
to nta_agent_add_tport:

  nua->nua_nta = nta_agent_create(root, NONE, NULL, NULL,
                                  /* REMOVE TPTAG_CERTIFICATE(certificate_dir), 
*/
                                  NTATAG_TAG_3261(0),
                                  TAG_NEXT(nua->nua_args));
  if (!nua->nua_nta)
    return -1;

  if (!contact && !sips_contact) {
    if (nta_agent_add_tport(nua->nua_nta, NULL,
                            TAG_NEXT(nua->nua_args)) < 0 &&
        nta_agent_add_tport(nua->nua_nta,
URL_STRING_MAKE("sip:*:*"),
                            TAG_NEXT(nua->nua_args)) < 0)
      return -1;
  }
  else if ((!contact ||
       nta_agent_add_tport(nua->nua_nta, contact,
                           TAG_NEXT(nua->nua_args)) < 0) &&
      (!sips_contact ||
       nta_agent_add_tport(nua->nua_nta, sips_contact,
/* ADD */                          TPTAG_CERTIFICATE(certificate_dir),
TAG_NEXT(nua->nua_args)) < 0)) {
    return -1;

Am I on the right track?


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=756076&aid=1465023&group_id=143636


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sofia-sip-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel

Reply via email to