Skip to content

Commit

Permalink
Fix a few issues with the C generator (part 5) (#20313)
Browse files Browse the repository at this point in the history
* [C] Default to requiring valid SSL

* Update samples

---------

Co-authored-by: Sam Bingner <[email protected]>
  • Loading branch information
eafer and Sam Bingner authored Dec 14, 2024
1 parent 2f03c70 commit 1a3d7d4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,8 @@ void apiClient_invoke(apiClient_t *apiClient,
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 2L);
}
} else {
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 2L);
}
}

Expand Down
4 changes: 2 additions & 2 deletions samples/client/others/c/bearerAuth/src/apiClient.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,8 @@ void apiClient_invoke(apiClient_t *apiClient,
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 2L);
}
} else {
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 2L);
}
}

Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/c-useJsonUnformatted/src/apiClient.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ void apiClient_invoke(apiClient_t *apiClient,
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 2L);
}
} else {
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 2L);
}
}

Expand Down
4 changes: 2 additions & 2 deletions samples/client/petstore/c/src/apiClient.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ void apiClient_invoke(apiClient_t *apiClient,
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 2L);
}
} else {
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 0L);
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt(handle, CURLOPT_SSL_VERIFYHOST, 2L);
}
}

Expand Down

0 comments on commit 1a3d7d4

Please sign in to comment.