zeromq/libzmq — pull request #557 by hintjens (2013-05-17 16:32:22+00:00)
Title: Added as_server to options

- set by ZMQ_PLAIN_SERVER setting
- code no longer uses bind/connect direction

There may be a simpler way to configure this but it'll do for now. See tests/test_security.cpp for example use.

We need to find a way to report authentication failures at the client side; I'd think a permanent error on the socket is sane (so all recvs/sends fail). For server authentication, we may make an inproc socket that does authentication. I'll think of a design for this; it should be per-context and deliver messages containing the service name (a string the server needs to set), mechanism, and client credentials, which depend on the mechanism. The authentication code then checks whatever database it uses, and returns an OK/NOK reply.