I am looking for sample code on mg_download.
My current issue is: when I request the download of a SSL page I get "SSL initialization error".
...
unsigned int res = mg_init_library( MG_FEATURES_SSL ); // returns 0
memset(&callbacks, 0, sizeof(callbacks));
callbacks.init_ssl = init_ssl; // it is an empty function returning 0
callbacks.log_message = log_message;
ctx= mg_start(&callbacks, 0, NULL);
a = mg_check_feature( MG_FEATURES_SSL ); // returns 2
// function download
...
char host[] = "google.com";
int port = 80, ssl = 1; // 0
char uri[] = "/";
char errBuf[1000];
struct mg_connection* conn = mg_download(host, port, ssl, errBuf, 1000, "GET %s HTTP/1.0\r\nHost: %s\r\n\r\n", uri, host);
// RETURNS conn = NULL
// errBuf = "SSL is not initialized"
Thanks for you patience and help,
Matteo