[MDEV-30178] Error message when 'require_secure_transport' is enabled should be more explict Created: 2022-12-08 Updated: 2023-09-07 Resolved: 2023-07-25 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | SSL |
| Fix Version/s: | 11.2.1 |
| Type: | Task | Priority: | Trivial |
| Reporter: | Tingyao Nian | Assignee: | Daniel Black |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | beginner-friendly | ||
| Issue Links: |
|
||||||||
| Description |
|
'require_secure_transport' is introduced since 10.4 Enterprise https://mariadb.com/docs/skysql/ref/mdb/system-variables/require_secure_transport/
However the error message emitted when connection s refused is not at all explanatory. If this variable is enabled and a client tries to connect without encryption, following error message will be seen:
It does not provide any useful information to suggest user to connect with encryption, neither does it mention the related parameter 'require_secure_transport'. The equivalent message from MySQL for example contains more information:
It would be beneficial to change this error message in MariaDB to reflect that the variable is enabled and to suggest user to use encrypted connection. |
| Comments |
| Comment by Daniel Black [ 2022-12-08 ] | ||||||||||||||||
|
Note it was added in 10.5.2 on the MariaDB community version. | ||||||||||||||||
| Comment by Daniel Lenski [ 2022-12-08 ] | ||||||||||||||||
|
Additionally, when attempting to connect using TLS certificate validation, but failing to validate the server certs… the error messages are of an extremely poor quality: Connect to a server where the server's cert is self-signed, or otherwise can't be validated by the system-default CA bundle
Contrast this with, say, the higher-quality error message produced by GnuTLS:
Connect to a server where the server's hostname doesn't match its certificateThe easiest way to demonstrate this is to connect by IP address to a server whose certificate contains only its hostname, but not its IP address(es):
Contrast this with, say, the higher-quality error message produced by GnuTLS:
| ||||||||||||||||
| Comment by Daniel Lenski [ 2022-12-08 ] | ||||||||||||||||
|
Related: The default connection security of MariaDB clients (command-line tools and connector libraries) is extremely weak — and even worse, it's misleading to end users:
| ||||||||||||||||
| Comment by Daniel Black [ 2022-12-08 ] | ||||||||||||||||
|
dlenski, those two are are in the Connector/C and should be a different bug if one doesn't exist already. Though looking at the code, you are right other TLS errors fall straight under the to ER_ACCESS_DENIEDs error with no TLS / require_secure_storage mention. Tingynia looking at what it would take to fix, the code in sql/sql_acl.cc:acl_check_ssl is where to start that needs to return different errors codes. Error messages with the same code I think can be introduced.
Is this something you are willing to try to write code to correct? | ||||||||||||||||
| Comment by Sergei Golubchik [ 2022-12-26 ] | ||||||||||||||||
|
dlenski, see also | ||||||||||||||||
| Comment by Daniel Lenski [ 2022-12-28 ] | ||||||||||||||||
|
serg wrote:
The counterargument is that "almost every ssl-enabled MariaDB installation in the world" is already broken: an ISP or government can easily MITM traffic to/from MariaDB servers if they're not actually doing certification validation. This has been an extremely common and plausible threat model for almost a decade now. | ||||||||||||||||
| Comment by Sergei Golubchik [ 2022-12-28 ] | ||||||||||||||||
|
Yes, you're right. They're already broken. | ||||||||||||||||
| Comment by Daniel Black [ 2023-03-29 ] | ||||||||||||||||
|
serg I assume you want to review everything to do with authentication. AFAIK https://github.com/MariaDB/server/pull/2581 looks correct. Which version to target is an outstanding question. In its current from using the same 28000 is back to 10.5 ok? | ||||||||||||||||
| Comment by Daniel Lenski [ 2023-03-29 ] | ||||||||||||||||
+ dufravin, who's the author of this PR. | ||||||||||||||||
| Comment by Sergei Golubchik [ 2023-07-21 ] | ||||||||||||||||
|
https://github.com/MariaDB/server/pull/2581/commits/f6535644da is ok to push |