From 3819a9e8542e4190250184126e33502bfd17ac5b Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sun, 3 Mar 2024 10:04:06 +0100 Subject: [PATCH] disable ssl verification --- src/kds_s2000w_client.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/kds_s2000w_client.c b/src/kds_s2000w_client.c index 144c314..00ef60e 100644 --- a/src/kds_s2000w_client.c +++ b/src/kds_s2000w_client.c @@ -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); -- 2.39.5