examples/complicated: fix warnings, bump deprecated callback, tidy up

Also: make them C89, add consts.

Closes #15785
This commit is contained in:
Viktor Szakats 2024-12-20 02:00:22 +01:00
parent fa0ccd9f1f
commit 37fb50a858
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
15 changed files with 199 additions and 132 deletions

View file

@ -41,6 +41,11 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *parm)
{
CURLcode rv = CURLE_ABORTED_BY_CALLBACK;
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Woverlength-strings"
#endif
/** This example uses two (fake) certificates **/
static const char mypem[] =
"-----BEGIN CERTIFICATE-----\n"
@ -85,6 +90,10 @@ static CURLcode sslctx_function(CURL *curl, void *sslctx, void *parm)
"Z05phkOTOPu220+DkdRgfks+KzgHVZhepA==\n"
"-----END CERTIFICATE-----\n";
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
BIO *cbio = BIO_new_mem_buf(mypem, sizeof(mypem));
X509_STORE *cts = SSL_CTX_get_cert_store((SSL_CTX *)sslctx);
int i;
@ -178,5 +187,5 @@ int main(void)
curl_easy_cleanup(ch);
curl_global_cleanup();
return rv;
return (int)rv;
}