Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/Apache.IoTDB.Samples/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/Apache.IoTDB/Apache.IoTDB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="ApacheThrift" Version="0.14.1" />
<PackageReference Include="ApacheThrift" Version="0.22.0" />
</ItemGroup>
<ItemGroup
Condition="'$(TargetFramework)' == 'net461' or '$(TargetFramework)' == 'netstandard2.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net461' or '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="IndexRange" Version="1.0.2" />
</ItemGroup>
<ItemGroup>
<None Include="../../README.md" Pack="true" PackagePath="\"/>
<None Include="../../README.md" Pack="true" PackagePath="\" />
</ItemGroup>

</Project>
15 changes: 12 additions & 3 deletions src/Apache.IoTDB/SessionPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -449,10 +450,18 @@ public async Task<string> GetTimeZone()

private async Task<Client> 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);

Expand Down
Loading