From 5066dd706671e0aaa35f01da216118a6e078a2f9 Mon Sep 17 00:00:00 2001 From: HTHou Date: Tue, 21 Apr 2026 10:28:52 +0800 Subject: [PATCH 1/2] Upgrade ApacheThrift to 0.22.0 --- src/Apache.IoTDB/Apache.IoTDB.csproj | 7 +++---- src/Apache.IoTDB/SessionPool.cs | 15 ++++++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/Apache.IoTDB/Apache.IoTDB.csproj b/src/Apache.IoTDB/Apache.IoTDB.csproj index 4096948..dc01c44 100644 --- a/src/Apache.IoTDB/Apache.IoTDB.csproj +++ b/src/Apache.IoTDB/Apache.IoTDB.csproj @@ -17,14 +17,13 @@ - + - + - + diff --git a/src/Apache.IoTDB/SessionPool.cs b/src/Apache.IoTDB/SessionPool.cs index 8d42282..1c12d85 100644 --- a/src/Apache.IoTDB/SessionPool.cs +++ b/src/Apache.IoTDB/SessionPool.cs @@ -21,6 +21,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Net; using System.Security.Cryptography.X509Certificates; using System.Threading; using System.Threading.Tasks; @@ -449,10 +450,18 @@ public async Task GetTimeZone() private async Task CreateAndOpen(string host, int port, bool enableRpcCompression, int timeout, bool useSsl, string cert, string sqlDialect, string database, CancellationToken cancellationToken = default) { + TTransport socket; - TTransport socket = useSsl ? - new TTlsSocketTransport(host, port, null, timeout, new X509Certificate2(File.ReadAllBytes(cert))) : - new TSocketTransport(host, port, null, timeout); + if (useSsl) + { + socket = IPAddress.TryParse(host, out var ipAddress) + ? new TTlsSocketTransport(ipAddress, port, null, cert) + : new TTlsSocketTransport(host, port, null, timeout, new X509Certificate2(cert)); + } + else + { + socket = new TSocketTransport(host, port, false, null, timeout); + } var transport = new TFramedTransport(socket); From a4114bf1ad9acab337309d1bd6e428f72e9afbcd Mon Sep 17 00:00:00 2001 From: HTHou Date: Tue, 21 Apr 2026 10:37:23 +0800 Subject: [PATCH 2/2] Use aspnet 9.0 for samples Docker image --- samples/Apache.IoTDB.Samples/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/Apache.IoTDB.Samples/Dockerfile b/samples/Apache.IoTDB.Samples/Dockerfile index 52b2dcf..be99440 100644 --- a/samples/Apache.IoTDB.Samples/Dockerfile +++ b/samples/Apache.IoTDB.Samples/Dockerfile @@ -17,7 +17,7 @@ #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. -FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build