Typedefs | Enumerations | Functions
MyQtt SSL/TLS: support functions to create secured SSL/TLS MQTT connections and listeners

Typedefs

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. More...
 
typedef axl_bool(* MyQttSslPostCheck )(MyQttCtx *ctx, MyQttConn *conn, axlPointer SSL_CTX, axlPointer SSL, axlPointer user_data)
 Optional user defined handler that allows to execute SSL post checks code before proceed. More...
 
typedef char *(* MyQttTlsCertificateFileLocator )(MyQttCtx *ctx, MyQttConn *connection, const char *serverName, axlPointer user_data)
 Handler definition for those functions that allows to locate the certificate file to be used while enabling TLS support. More...
 
typedef char *(* MyQttTlsChainCertificateFileLocator )(MyQttCtx *ctx, MyQttConn *connection, const char *serverName, axlPointer user_data)
 Handler definition for those functions that allows to locate the chain/intermediate certificate file to be used while enabling TLS support. More...
 
typedef void(* MyQttTlsFailureHandler )(MyQttConn *conn, const char *error_message, axlPointer user_data)
 Handler called when a failure is found during TLS handshake. More...
 
typedef axl_bool(* MyQttTlsPostCheck )(MyQttConn *conn, axlPointer user_data, axlPointer ssl, axlPointer ctx)
 Allows to configure a post-condition function to be executed to perform additional checkings. More...
 
typedef char *(* MyQttTlsPrivateKeyFileLocator )(MyQttCtx *ctx, MyQttConn *connection, const char *serverName, axlPointer user_data)
 Handler definition for those functions that allows to locate the private key file to be used while enabling TLS support. More...
 

Enumerations

enum  MyQttDigestMethod { MYQTT_SHA1 = 1, MYQTT_MD5 = 2 }
 Digest method provided. More...
 
enum  MyQttSslProtocol { MYQTT_METHOD_SSLV23 = 2, MYQTT_METHOD_SSLV3 = 3, MYQTT_METHOD_TLSV1 = 4 }
 SSL/TLS protocol type to use for the client or listener connection. More...
 

Functions

MyQttConnmyqtt_tls_conn_new (MyQttCtx *ctx, const char *client_identifier, axl_bool clean_session, int keep_alive, const char *host, const char *port, MyQttConnOpts *opts, MyQttConnNew on_connected, axlPointer user_data)
 Allows to create a new MQTT connection a MQTT broker/server securing first the connection with TLS (MQTT over TLS). More...
 
MyQttConnmyqtt_tls_conn_new6 (MyQttCtx *ctx, const char *client_identifier, axl_bool clean_session, int keep_alive, const char *host, const char *port, MyQttConnOpts *opts, MyQttConnNew on_connected, axlPointer user_data)
 Allows to create a new MQTT connection to a MQTT broker/server securing first the connection with TLS (MQTT over TLS), forcing IPv6 transport. More...
 
char * myqtt_tls_get_digest (MyQttDigestMethod method, const char *string)
 Allows to create a digest from the provided string. More...
 
char * myqtt_tls_get_digest_sized (MyQttDigestMethod method, const char *content, int content_size)
 Allows to create a digest from the provided string, configuring the size of the string to be calculated. More...
 
char * myqtt_tls_get_peer_ssl_digest (MyQttConn *connection, MyQttDigestMethod method)
 Allows to return the certificate digest from the remote peer given TLS session is activated (this is also called the certificate fingerprint). More...
 
axlPointer myqtt_tls_get_ssl_object (MyQttConn *connection)
 Returns the SSL object associated to the given connection. More...
 
axl_bool myqtt_tls_init (MyQttCtx *ctx)
 Initialize TLS library. More...
 
axl_bool myqtt_tls_is_on (MyQttConn *conn)
 Allows to check if the provided connection has TLS activated. More...
 
MyQttConnmyqtt_tls_listener_new (MyQttCtx *ctx, const char *host, const char *port, MyQttConnOpts *opts, MyQttListenerReady on_ready, axlPointer user_data)
 Allows to start a MQTT server on the provided local host address and port running secure TLS protocol (secure-mqtt). More...
 
MyQttConnmyqtt_tls_listener_new6 (MyQttCtx *ctx, const char *host, const char *port, MyQttConnOpts *opts, MyQttListenerReady on_ready, axlPointer user_data)
 Creates a new TCP/IPv6 MyQtt Listener accepting incoming connections on the given host:port configuration running TLS protocol (secure-mqtt). More...
 
void myqtt_tls_listener_set_certificate_handlers (MyQttCtx *ctx, MyQttTlsCertificateFileLocator certificate_handler, MyQttTlsPrivateKeyFileLocator private_key_handler, MyQttTlsChainCertificateFileLocator chain_handler, axlPointer user_data)
 Allows to configure the set of functions that will help the engine to find the appropriate certificate/key/chain according to the serverName announced by the SNI indication. More...
 
void myqtt_tls_opts_set_server_name (MyQttConnOpts *opts, const char *serverName)
 Allows to set the serverName indication (SNI) that is going to be used by the client connection created using the provided connection options object. More...
 
axl_bool myqtt_tls_opts_set_ssl_certs (MyQttConnOpts *opts, const char *certificate, const char *private_key, const char *chain_certificate, const char *ca_certificate)
 Allows to certificate, private key and optional chain certificate and ca for on a particular options that can be used for a client and a listener connection. More...
 
void myqtt_tls_opts_ssl_peer_verify (MyQttConnOpts *opts, axl_bool verify)
 Allows to disable peer ssl certificate verification. More...
 
axl_bool myqtt_tls_set_certificate (MyQttConn *listener, const char *certificate, const char *private_key, const char *chain_file)
 Allows to configure the TLS certificate and key to be used on the provided connection. More...
 
void myqtt_tls_set_default_post_check (MyQttCtx *ctx, MyQttTlsPostCheck post_check, axlPointer user_data)
 Allows to configure a function that will be executed at the end of the TLS process, before returning the connection to the application level. More...
 
void myqtt_tls_set_failure_handler (MyQttCtx *ctx, MyQttTlsFailureHandler failure_handler, axlPointer user_data)
 Allows to configure a failure handler that will be called when a failure is found at SSL level or during the handshake with the particular function failing. More...
 
void myqtt_tls_set_post_check (MyQttConn *connection, MyQttTlsPostCheck post_check, axlPointer user_data)
 Allows to configure a function that will be executed at the end of the TLS process, before returning the connection to the application level. More...
 
void myqtt_tls_set_ssl_context_creator (MyQttCtx *ctx, MyQttSslContextCreator context_creator, axlPointer user_data)
 Allows to configure the handler that will be used to let user land code to define OpenSSL SSL_CTX object. More...
 
axl_bool myqtt_tls_verify_cert (MyQttConn *connection)
 Allows to verify peer certificate after successfully establish TLS session. More...
 

Detailed Description