Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error "ERROR [HY000] SSL Exception: Error during handshake: failed to read data" on connect #438

Open
avbasov opened this issue Feb 1, 2024 · 2 comments

Comments

@avbasov
Copy link

avbasov commented Feb 1, 2024

ODBC driver version 1.2.1.20220905
OS Window 11 Pro

I added an ODBC Data Source with name dwh-01 and URL https://clickhouse-01.int.company.com:8443.

I use a Power Shell script to test the connection

$connectstring = "DSN=dwh-01;Uid=test_user;Pwd=test;"
$sql = @'
show tables;
'@
$connection = New-Object System.Data.Odbc.OdbcConnection($connectstring)
$connection.open()
$command = New-Object system.Data.Odbc.OdbcCommand($sql,$connection)
$data = New-Object system.Data.Odbc.OdbcDataAdapter($command)
$datatable = New-Object system.Data.datatable
$null = $data.fill($datatable)
$conn.close()
$datatable 

The script freezes for a couple of minutes and then throws an error

 Exception calling "Fill" with "1" argument(s): "ERROR [HY000] SSL Exception: Error during handshake: failed to read data"
At line:10 char:1
+ $null = $data.fill($datatable)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : OdbcException
 
You cannot call a method on a null-valued expression.
At line:11 char:1
+ $conn.close()
+ ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull 

In CH logs I can see

2024.02.01 14:26:08.679925 [ 765 ] {} <Error> ServerErrorHandler: Code: 209. DB::NetException: Timeout exceeded while reading from socket (10.*.*.*:52793, 30000 ms). (SOCKET_TIMEOUT), Stack trace (when copying this message, always include the lines below):

0. DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x000000000c6d5d7b in /usr/bin/clickhouse
1. DB::NetException::NetException<String, long>(int, FormatStringHelperImpl<std::type_identity<String>::type, std::type_identity<long>::type>, String&&, long&&) @ 0x000000000c975796 in /usr/bin/clickhouse
2. DB::ReadBufferFromPocoSocket::nextImpl() @ 0x000000000c97532c in /usr/bin/clickhouse
3. DB::HTTPServerRequest::HTTPServerRequest(std::shared_ptr<DB::IHTTPContext>, DB::HTTPServerResponse&, Poco::Net::HTTPServerSession&) @ 0x0000000012697fce in /usr/bin/clickhouse
4. DB::HTTPServerConnection::run() @ 0x00000000126965a4 in /usr/bin/clickhouse
5. Poco::Net::TCPServerConnection::start() @ 0x00000000150f4e52 in /usr/bin/clickhouse
6. Poco::Net::TCPServerDispatcher::run() @ 0x00000000150f5c51 in /usr/bin/clickhouse
7. Poco::PooledThread::run() @ 0x00000000151ece67 in /usr/bin/clickhouse
8. Poco::ThreadImpl::runnableEntry(void*) @ 0x00000000151eb45c in /usr/bin/clickhouse
9. ? @ 0x00007fe12cef6609 in ?
10. ? @ 0x00007fe12ce1b353 in ?
 (version 23.12.2.59 (official build))

Clickhouse version 23.12.2.59 (official build) is running in docker.
TLS certs are issued by Let's Encrypt.
CH SSL configs:

    <openSSL>
        <server>
            <certificateFile>/etc/clickhouse-server/certs/clickhouse-01.int.company.com.crt</certificateFile>
            <privateKeyFile>/etc/clickhouse-server/certs/clickhouse-01.int.company.com.key</privateKeyFile>
            <verificationMode>relaxed</verificationMode>
            <cacheSessions>true</cacheSessions>
            <disableProtocols>sslv2,sslv3</disableProtocols>
            <preferServerCiphers>true</preferServerCiphers>
            <dhParamsFile>/etc/clickhouse-server/certs/dhparam.pem</dhParamsFile>
        </server>
    </openSSL>

Also tried to use the DSN in Excel, but no luck. I'd say it's kind of network problems, but at the same time on the same Windows VM Jetbrains DataGrip with JDBC driver works perfectly fine with the same CH instance.

@qq503618737
Copy link

May be you can try the old version like v1.0.0 20190523

@avbasov
Copy link
Author

avbasov commented Apr 4, 2024

Sorry can't try it. We have refused to use Power BI. So we don't need this driver anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants