[CONC-391] Unknown SSL error - MariaDB Created: 2019-02-27  Updated: 2019-12-03  Resolved: 2019-12-03

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 3.0.8
Fix Version/s: 3.1.6

Type: Bug Priority: Major
Reporter: Mochour Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: None
Environment:

HeidiSQL - 10.0.0.5460
MariaDB - 10.1.37 (with self-signed cert)
Windows 7 Pro


Attachments: File bilbo2.pcap     File solid2.pcap    
Issue Links:
Relates
relates to CONC-417 Windows clients using Schannel often ... Closed
relates to CONC-418 Use FormatMessage to get error string... Closed
relates to CONC-432 Use GnuTLS for Windows builds instead... Closed
relates to MDEV-13492 main.ssl_connect failed with 2026: U... Closed

 Description   

Steps to reproduce:

  • Open HeidiSQL;
  • Configure and Select a SSL connection to MariaDB server;
  • Open the connection;
  • I get message "Unknown SSL error 0x80090308

The behavior is different on two my PCs. On a desktop I can connect, on a laptop the error occurs.
Both PCs have basically same configuration (upgrades, tools installed).

You can see related communication here.

I can always connect from Ubuntu/Linux or Cygwin via mysql client.

I'v checked MS documentation it looks to me that problem is in file ma_schannel.c at line 842 – calling QueryContextAttributes.

Returns SEC_E_INVALID_TOKEN 0x80090308L.



 Comments   
Comment by Georg Richter [ 2019-02-28 ]

Hi,

Windows 7 is eoled and not an official supported platform.

However, it looks like there is a problem with the server certificate. Can you please provide some more information

  • a tcp dumo (wireshark capture)
  • your tls related connection settings
  • does the problem occur if you don't specify a root authority file (ca)

Thanks!

/Georg

Comment by Mochour [ 2019-03-01 ]

Hi,

see attached dumps.

  • solid - PC from which I can't connect
  • bilbo - PC from which I can connect

bilbo2.pcap solid2.pcap

Self-signed CA is installed on both PCs to the cert store.
I do not use in HeidiSQL any special SSL setting (CA certificate, certificate, cipher etc).

Yes, the problem occurs without root cert but also with it.

List of the supported cipher suites is same on both PCs.

Comment by Georg Richter [ 2019-03-02 ]

The problem doesn't occur in QueryContextAttributes, since the server certification is checked only if a root authority was specified.
According to the pcap files the handshake already fails, the server cert is checked by client after handshake.

It looks like more, that the used cipher "DHE-RSA-AES_256_CBC_SHA" is the reason of the problem. However, according to the discussion on HeidiSQL Github this cipher was already disabled?!

Comment by Mochour [ 2019-03-02 ]

OK, maybe it is not QueryContextAttributes, but it looks to me somehow connected with AcceptSecurityContext function or related. Returned value corresponds to SEC_E_INVALID_TOKEN value.

I can see in the Event Viewer Schannel error id 36888 when the connection fails.

Comment by Georg Richter [ 2019-03-02 ]

Can you confirm that the cipher above was disabled in registry?!

Comment by Mochour [ 2019-03-02 ]

This is the list of available ciphers from HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Cryptography\Configuration\Local\SSL\00010002

But it is same on both PCs...

TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P384
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P384
DHE-RSA-AES256-SHA
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_256_GCM_SHA384
TLS_RSA_WITH_AES_128_GCM_SHA256
TLS_RSA_WITH_AES_256_CBC_SHA256
TLS_RSA_WITH_AES_128_CBC_SHA256
TLS_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384_P384
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256_P256
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256_P384
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384_P384
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256_P256
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256_P384
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA_P256
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA_P384
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA_P256
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA_P384
TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
TLS_DHE_DSS_WITH_AES_256_CBC_SHA
TLS_DHE_DSS_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_3DES_EDE_CBC_SHA
TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA
TLS_RSA_WITH_RC4_128_SHA
TLS_RSA_WITH_RC4_128_MD5
TLS_RSA_WITH_NULL_SHA256
TLS_RSA_WITH_NULL_SHA
SSL_CK_RC4_128_WITH_MD5
SSL_CK_DES_192_EDE3_CBC_WITH_MD5

Comment by Mochour [ 2019-03-06 ]

It is not problem of the self-signed certificate. I have deployed letsencrypt certificate to the server and problem persists.

Comment by Georg Richter [ 2019-03-09 ]

The registry seems to be broken:
"DHE-RSA-AES256-SHA" is an OpenSSL cipher suite notation, but not valid for windows.

Does the problem still occurs, if you specify ssl_cipher=AES128_SHA256 ?

Comment by Mochour [ 2019-03-10 ]

I'm sorry, this is my mistake during copying of the cipher list. OpenSSL cipher is not there ...

This is the correct list:
TLS_RSA_WITH_AES_256_GCM_SHA384
TLS_RSA_WITH_AES_128_GCM_SHA256
TLS_RSA_WITH_AES_256_CBC_SHA256
TLS_RSA_WITH_AES_128_CBC_SHA256
TLS_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P384
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P256
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA_P384
TLS_DHE_RSA_WITH_AES_256_GCM_SHA384
TLS_DHE_RSA_WITH_AES_128_GCM_SHA256
TLS_DHE_RSA_WITH_AES_256_CBC_SHA
TLS_DHE_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384_P384
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256_P256
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256_P384
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384_P384
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256_P256
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256_P384
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA_P256
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA_P384
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA_P256
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA_P384
TLS_DHE_DSS_WITH_AES_256_CBC_SHA256
TLS_DHE_DSS_WITH_AES_128_CBC_SHA256
TLS_DHE_DSS_WITH_AES_256_CBC_SHA
TLS_DHE_DSS_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_3DES_EDE_CBC_SHA
TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA
TLS_RSA_WITH_RC4_128_SHA
TLS_RSA_WITH_RC4_128_MD5
TLS_RSA_WITH_NULL_SHA256
TLS_RSA_WITH_NULL_SHA
SSL_CK_RC4_128_WITH_MD5
SSL_CK_DES_192_EDE3_CBC_WITH_MD5

Comment by Mochour [ 2019-03-10 ]

Windows error - SSL connection error: no cipher match ...

Comment by Mochour [ 2019-03-12 ]

I needed to upgrade to win 10, so the problem disappered. Closing the issue.

Thanks

Comment by Georg Richter [ 2019-04-06 ]

Closed by user request

Comment by Geoff Montee (Inactive) [ 2019-12-03 ]

This should be fixed by the fix for MDEV-13492 and CONC-417.

Generated at Thu Feb 08 03:04:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.