+ fprintf(stderr,
+ "Notice: Unable to load TLS plugin - disabling SSL support! "
+ "(Reason: %s)\n", dlerror()
+ );
+ }
+ else
+ {
+ /* resolve functions */
+ if( !(conf.tls_init = dlsym(tls_lib, "uh_tls_ctx_init")) ||
+ !(conf.tls_cert = dlsym(tls_lib, "uh_tls_ctx_cert")) ||
+ !(conf.tls_key = dlsym(tls_lib, "uh_tls_ctx_key")) ||
+ !(conf.tls_free = dlsym(tls_lib, "uh_tls_ctx_free")) ||
+ !(conf.tls_accept = dlsym(tls_lib, "uh_tls_client_accept")) ||
+ !(conf.tls_close = dlsym(tls_lib, "uh_tls_client_close")) ||
+ !(conf.tls_recv = dlsym(tls_lib, "uh_tls_client_recv")) ||
+ !(conf.tls_send = dlsym(tls_lib, "uh_tls_client_send"))
+ ) {
+ fprintf(stderr,
+ "Error: Failed to lookup required symbols "
+ "in TLS plugin: %s\n", dlerror()
+ );
+ exit(1);
+ }
+
+ /* init SSL context */
+ if( ! (conf.tls = conf.tls_init()) )
+ {
+ fprintf(stderr, "Error: Failed to initalize SSL context\n");
+ exit(1);
+ }