typedef axlPointer(* MyQttSslContextCreator)(MyQttCtx *ctx, MyQttConn *conn, MyQttConnOpts *opts, axl_bool is_client, axlPointer 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 creator will be:

1 SSL_CTX * my_ssl_ctx_creator (MyQttCtx * ctx, MyQttConn * conn, MyQttConnOpts * opts, axl_bool is_client, axlPointer user_data)
2 {
3  // very basic context creator using default settings provided by OpenSSL
4  return SSL_CTX_new (is_client ? TLSv1_client_method () : TLSv1_server_method ());
5 }
Parameters
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_clientaxl_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 myqtt_tls_set_ssl_context_creator.
Returns
The function must return a valid SSL_CTX object (see OpenSSL documentation to know more about this) or NULL if it fails.