Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7164857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:08:42+00:00 2026-05-28T14:08:42+00:00

I am establishing a connection to a secured server over SSL. Everything works fine,

  • 0

I am establishing a connection to a secured server over SSL.
Everything works fine, my CAcertificate is well used through

retCode=curl_easy_setopt(handleCurl, CURLOPT_CAINFO, sSSLCertificate);
retCode=curl_easy_setopt(handleCurl, CURLOPT_SSL_VERIFYPEER, 1);

I’m stuck when i try to manage curl errors. Basically i want to be able to be notified when a problem happens with the SSL (wrong cacert.pem, server identity not verified etc).

Nothing happens when CURLOPT_CAINFO is given an empty CAcert, retCode is OK.

I tried to get info after the request with that :

res = curl_easy_getinfo(m_pHandleCurl, CURLINFO_SSL_VERIFYRESULT, &lSSLVerifyResult);

But it always tells me that everithing is fine.

What am i missing ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:08:43+00:00Added an answer on May 28, 2026 at 2:08 pm

    Add to your connection setup code:

    // Make sure this is NOT a stack variable! The buffer
    // must be available through whole live of the connection
    char buffer[CURL_ERROR_SIZE+1] = {};
    
    retCode=curl_easy_setopt(handleCurl, CURLOPT_ERRORBUFFER, buffer);
    

    then when your connection has ended, check what’s in the buffer – you should be able to see some hints regarding SSL state, too. It will be empty if no error occurred.

    If you want actual code, numeric CURLcode is always returned by curl_easy_perform for easy handles.

    If you use multi handles, use curl_multi_info_read instead. Here is example:

    int u = 0;
    if (CURLM_OK == curl_multi_perform(multi_, &u))
    {
      int q = 0;
      CURLMsg *msg = NULL;
      while ((msg = curl_multi_info_read(multi_, &q)) != NULL)
      {
        if (msg->msg == CURLMSG_DONE)
        {
          CURL* easy = msg->easy_handle;
          CURLcode code = msg->data.result;
          // . . .
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am establishing connection with the server and its working fine. But there are
An error has occurred while establishing a connection to the server. When connecting to
I am about to draw/document for some client-server connection establishing code to better understand
when I try to connect to my server through MySQL Connector/NET using SSL with
I am working on a mobile communicator and after establishing connection to the server
An error occured while establishing a connection to the server. When connecting to the
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The
I am establishing a connection to a mssql server database in asp using the
Hi i have a debian server. Today my site was showing Error establishing a
I have the below mentioned code in a seperate class file for establishing connection

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.