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

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.0.8, 3.1.0
    • 3.1.5
    • None
    • 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

              georg Georg Richter
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.