Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.0.8, 3.1.0
-
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:
Attachments
Issue Links
- causes
-
CONC-446 For Schannel errors, provide the hex error code in addition to the error string
-
- Closed
-
- relates to
-
CONC-391 Unknown SSL error - MariaDB
-
- Closed
-
-
CONC-417 Windows clients using Schannel often encounter error SEC_E_INVALID_TOKEN (0x80090308) - The token supplied to the function is invalid
-
- Closed
-
-
MDEV-13492 main.ssl_connect failed with 2026: Unknown SSL error (0x80090308)
-
- Closed
-
-
MDEV-13726 main.ssl_timeout, main.ssl_7937 failed (sporadically) in buildbot, unknown SSL error (0x80090308)
-
- Closed
-
I think it is good that it outputs a code in hex. If it outputs a Japanese message, on localized version of Windows, it would be much harder to make it actionable. 0x80090308 is about as user-friendly as "invalid token" to the end user, the end user cannot make anything out of the message. But 0x80090308 can gbe easily googled.
A programmer friendliest messages would probably contain hexadecimal code, name of the constant (e.g SEC_E_INVALID_TOKEN), and English text, and location (which function causes the error). The most friendly code could dump content of local variables, and cherry on top is callstack leading to the error.
0x80090308 SEC_E_INVALID_TOKEN - The function encountered an invalid token ,in AcquireSecurityContext()
More often than not, when client gets this message, it might mean that server sent an error packet "08S1 Bad handshake", while client is trying to parse this as part TLS handshake (ServerHello, or anything like that)