]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
disable ssl verification
authorBastian Dehn <hhaalo@arcor.de>
Sun, 3 Mar 2024 09:04:06 +0000 (10:04 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 3 Mar 2024 09:10:50 +0000 (10:10 +0100)
src/kds_s2000w_client.c

index 144c314a00f0b31ef3f97902f84b0f3c0e263ad1..00ef60ee043511bd75950941a216caaca34e003c 100644 (file)
@@ -80,6 +80,8 @@ int kds_s2000w_client_open_session(response* response)
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, body);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _kds_s2000w_client_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) response);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
        CURLcode result = curl_easy_perform(curl);
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
 
@@ -113,6 +115,8 @@ void kds_s2000w_client_close_session(int64_t sessionid)
        curl_easy_setopt(curl, CURLOPT_URL, url);
        curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
        curl_easy_perform(curl);
 
        curl_url_cleanup(url_handler);
@@ -147,6 +151,8 @@ int kds_s2000w_client_status_session(int64_t sessionid, response* response)
        curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _kds_s2000w_client_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) response);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
        CURLcode result = curl_easy_perform(curl);
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
 
@@ -183,6 +189,8 @@ int kds_s2000w_client_start_scan(int64_t sessionid, response* response)
        curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0L);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _kds_s2000w_client_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) response);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
        CURLcode result = curl_easy_perform(curl);
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
 
@@ -219,6 +227,8 @@ int kds_s2000w_client_stop_scan(int64_t sessionid, response* response)
        curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0L);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _kds_s2000w_client_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) response);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
        CURLcode result = curl_easy_perform(curl);
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
 
@@ -256,6 +266,8 @@ int kds_s2000w_client_get_metadata(int64_t sessionid, int img_number, response*
        curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _kds_s2000w_client_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) response);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
        CURLcode result = curl_easy_perform(curl);
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
 
@@ -293,6 +305,8 @@ int kds_s2000w_client_get_image(int64_t sessionid, int img_number, response* res
        curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _kds_s2000w_client_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) response);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
        CURLcode result = curl_easy_perform(curl);
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
 
@@ -330,6 +344,8 @@ int kds_s2000w_client_delete_image(int64_t sessionid, int img_number, response*
        curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "DELETE");
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _kds_s2000w_client_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) response);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
        CURLcode result = curl_easy_perform(curl);
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
 
@@ -360,6 +376,8 @@ int kds_s2000w_client_get_capabilities(response* response)
        curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _kds_s2000w_client_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) response);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
        CURLcode result = curl_easy_perform(curl);
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
 
@@ -395,6 +413,8 @@ int kds_s2000w_client_get_option(int64_t sessionid, response* response)
        curl_easy_setopt(curl, CURLOPT_HTTPGET, 1L);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, _kds_s2000w_client_callback);
        curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*) response);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
        CURLcode result = curl_easy_perform(curl);
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);
 
@@ -430,6 +450,8 @@ int kds_s2000w_client_set_option(int64_t sessionid, response* response)
        curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "PUT");
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, response->data);
        curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, response->size);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+       curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
        CURLcode result = curl_easy_perform(curl);
        curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response->code);