'Specify a callback function that will be called when a server offers
Next Protocol Negotiation options.
:param callback: The callback function.  It will be invoked with two
arguments: the Connection, and a list of offered protocols as
bytestrings, e.g. ``[b\'http/1.1\', b\'spdy/2\']``.  It should return
one of those bytestrings, the chosen protocol.'

@_requires_npn
def set_npn_select_callback(self, callback):

    self._npn_select_helper = _NpnSelectHelper(callback)
    self._npn_select_callback = self._npn_select_helper.callback
    _lib.SSL_CTX_set_next_proto_select_cb(self._context, self._npn_select_callback, _ffi.NULL)
