typedef noPollPtr(* noPollSslContextCreator)(noPollCtx *ctx, noPollConn *conn, noPollConnOpts *opts, nopoll_bool is_client, noPollPtr user_data)

An optional handler that allows user land code to define how is SSL_CTX (SSL context) created and which are the settings it should have before taking place SSL/TLS handshake.

NOTE: that the function should return one context for every connection created. Do not reuse unless you know what you are doing.

A very bare implementation for this context creation will be:

1 SSL_CTX * my_ssl_ctx_creator (noPollCtx * ctx, noPollConn * conn, noPollConnOpts * opts, nopoll_bool is_client, noPollPtr user_data)
2 {
3  // very basic context creation using default settings provided by OpenSSL
4  return SSL_CTX_new (is_client ? TLSv1_client_method () : TLSv1_server_method ());
5 }
ctxThe context where the operation is taking place.
connThe connection that is being requested for a new context (SSL_CTX). Use is_client to know if this is a connecting client or a listener connection.
optsOptional reference to the connection object created for this connection.
is_clientnopoll_true to signal that this is a request for a context for a client connection. Otherwise, it is for a listener connection.
user_dataUser defined pointer that received on this function as defined at nopoll_ctx_set_ssl_context_creator.
The function must return a valid SSL_CTX object (see OpenSSL documentation to know more about this) or NULL if it fails.