Author Topic: ERROR:Failed to read beginning of SSL/TLS record while calling FullRequestSb  (Read 290 times)

abhishek

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
I am Trying to create calendar in my gmail account using REST api of chilkat. But when i am executing this line

 success = rest.FullRequestSb(L"POST",L"/calendar/v3/calendars",sbReq,sbJson);
 i am gettting error.here is error my log.

ChilkatLog:
  FullRequestSb:
    DllDate: May 24 2018
    ChilkatVersion: 9.5.0.73
    UnlockPrefix: Anything for 30-day trial
    Architecture: Little Endian; 32-bit
    Language: Visual C++ 9.0 (32-bit)
    VerboseLogging: 0
    fullRequestBody:
      Sending request with body...
      Sent request.
      fullRequestGetResponse:
        Reading response header...
        Failed to read beginning of SSL/TLS record.
        b: 0
        dbSize: 0
        nReadNBytes: 0
        idleTimeoutMs: 30000
        Failed to receive more TLS application data.
        tlsApp: Socket operation timeout.
        elapsedMs: Elapsed time: 30078 millisec
        Failed.
        Failed to read response header.
      --fullRequestGetResponse
    --fullRequestBody
    Failed.
  --FullRequestSb
--ChilkatLog


and here is my code that i am using.

CkGlobalW glob;
    bool success = glob.UnlockBundle(L"Anything for 30-day trial");
   const wchar_t* b1 = glob.lastErrorText();
   CkRestW rest;
 
    //   Provide a previously obtained OAuth2 access token.
    CkOAuth2W oauth2;
    oauth2.put_AccessToken(L"OAUTH2_ACCESS_TOKEN");
    rest.SetAuthOAuth2(oauth2);

    success = rest.Connect(L"imap.gmail.com",993,true,true);
    if (success != true) {
      const wchar_t* b = rest.lastErrorText();
        return;
    }

if(success == true)
   {
      success = rest.SetAuthBasic(L"xyz@gmail.com", L"password");
      if(success == true)
      {
         
    //  The following code creates the JSON request body.
    //  The JSON created by this code is shown below.
         
    CkJsonObjectW jsonReq;
    jsonReq.UpdateString(L"summary",L"test calendar abc");

    CkStringBuilderW sbReq;
    jsonReq.EmitSb(sbReq);

    rest.AddHeader(L"Content-Type",L"application/json");

    CkStringBuilderW sbJson;
    success = rest.FullRequestSb(L"POST",L"/calendar/v3/calendars",sbReq,sbJson); // error line
    if (success != true) {
      const wchar_t* b = rest.lastErrorText();
        return;
    }

    if (rest.get_ResponseStatusCode() != 200) {
      int statuscode = rest.get_ResponseStatusCode();
      const wchar_t* str = sbJson.getAsString();
        return;
    }