Hi James, How can my_awesome_callback() know the specific custom NPN advertisement list for a given netVC?
The purpose of the API is not to trigger the callback, but, to update/modify the npnAdvertised list for a given netVC. The callback part is trivial and I basically would do something similar to what you pointed (I just reuse the existing advertise_next_protocol() callback instead of my_awesome_callback(), but, check (and use) if there¹s a custom npnAdvertised list set for that netVC). For example, if we have SNI=<domain1>; http/1.1,spdy/3.1 SNI=<domain2>; spdy/3.1,http/1.1 All connections with SNI=domain1, needs to be advertised ³http/1.1, spdy/3.1², while the ones with domain2 needs to get the opposite. Thanks, Sudheer On 11/18/14, 8:28 AM, "James Peach" <jpe...@apache.org> wrote: > >> On Nov 17, 2014, at 4:09 PM, Sudheer Vinukonda >><sudhe...@yahoo-inc.com.INVALID> wrote: >> >> Hi All, >> >> I would like add a new API TSSslAdvertiseProtocolSet(), to address the >> requirement of modifying the NPN advertising list for each SSL >>connection >> based on SNI (please refer TS-3153). >> >> https://issues.apache.org/jira/browse/TS-3153 >> >> >> Below is a brief description of the API. Please review and provide >> comments/concerns. > >Why do you need this API when you can just do: > >SSL_CTX_set_next_protos_advertised_cb(TSVConnSSLConnectionGet(vc), >my_awesome_callback, foo); > >> >> >> >> +TSSslAdvertiseProtocolSet >> +============ >> + >> +Synopsis >> +-------- >> + >> +`#include <ts/ts.h>` >> + >> +.. c:function:: TSReturnCode TSSslAdvertiseProtocolSet(TSVConn sslp, >> const unsigned char ** list, unsigned int count); >> + >> +Description >> +----------- >> + >> + Modifies the NPN advertisement list for a given SSL connection with >> :arg:`list`. If :arg:`count` is 0, sets the NPN advertisement list to >>the >> default registered protocol list for the end point. Note that, the >>plugin >> that uses this API owns the :arg:`list` and is responsible for making >>sure >> it points to a valid memory. >> + >> >> >> >> Thanks, >> >> Sudheer >> >