Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-418

Use FormatMessage to get error string for unknown Schannel error codes

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0, 3.0.8
    • Fix Version/s: 3.1.5
    • Labels:
      None

      Description

      If MariaDB Connector/C encounters an unknown Schannel error, then it currently prints a message like this:

      Unknown SSL error (0x80090308)
      

      It does this here:

      https://github.com/MariaDB/mariadb-connector-c/blob/v3.1.0/libmariadb/secure/ma_schannel.c#L80

      This is not very user friendly. It would probably be better if it could print the textual error message instead.

      The windows API has the FormatMessage function that can be used to get the textual error message from the error code.

      https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-formatmessage

      For an example, see this:

      https://stackoverflow.com/questions/1387064/how-to-get-the-error-message-from-the-error-code-returned-by-getlasterror

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              georg Georg Richter
              Reporter:
              GeoffMontee Geoff Montee
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: