2016-10-25 6 views
0

Ich möchte einen HTTPS-Aufruf über libcurl machen. Sowohl cURL als auch OpenSSL wurden aus Quellen erstellt.HTTPS nicht unterstützt, aber OpenSSL aktiviert?

Ich konfigurierte cURL mit /configure --enable-shared=no --with-zlib=/usr/local --with-ssl=/usr/local/ssl. Wenn ich cURL mit SSL-Unterstützung bauen, es wieder zu mir:

enter image description here

Allerdings, wenn ich versuchen, die libcurl-Code auszuführen, die darunter ist:

CURL *curl; 
CURLcode res; 
curl_global_init(CURL_GLOBAL_DEFAULT); 
curl = curl_easy_init(); 
    if (curl) { 
     CurlResponse = ""; 
     host = "https://host.com"; 
     curl_easy_setopt(curl, CURLOPT_URL, (host).c_str()); 
     curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1); 
     curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); 
     curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "Type=Initialize"); 
     curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, LibcurlResponse); 
     curl_easy_setopt(curl, CURLOPT_WRITEDATA, &CurlResponse); 
     res = curl_easy_perform(curl); 
     if (res != CURLE_OK) { 
      LibcurlError(curl_easy_strerror(res), host); 
      } 
     curl_easy_cleanup(curl); 
     } 
    curl_global_cleanup(); 

ich die Fehler erhalten (von verbose-Modus):

* Protocol https not supported or disabled in libcurl 
* Unsupported protocol 
Libcurl error: Unsupported protocol 

Also, wie kann ich eine SSL-Anfrage per HTTPS-Server machen ....

Vielen Dank für Ihre Antworten

BTW MinGW Codeblöcke Setup :)

+0

Hallo, womit beziehen Sie sich auf mit der cURL configure Linie? Ich nehme folgendes an: ./configure --enable-shared = no --with-zlib =/usr/local --with-ssl =/usr/local –

+0

Ein lokaler OpenSSL-Build befindet sich normalerweise in '/ usr/local/ssl '. Kannst du bestätigen, dass du es tatsächlich konfiguriert und installiert hast? '/ Usr/local' anstelle von '/ usr/local/ssl'? – jww

+0

Mein Fehler, ich wollte local/ssl eingeben –

Antwort

-1

Ich habe erfolgreich bauen OpenSSL und Libcurl mit SSL-Unterstützung.

Wenn jemand an der Antwort interessiert ist, wenden Sie sich bitte an mee für Informationen über den Ansatz.

MinGW Codeblöcke Setup nur

Verwandte Themen