diff options
author | Innokentii Mokin <innokentii@ydb.tech> | 2024-11-22 12:09:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-22 12:09:34 +0300 |
commit | a18f18d81996ca8e681bb6cabd441b52833d99bf (patch) | |
tree | 7c083d8be0cc054778791f4a177b5a767e356e9f | |
parent | b7cfb3622d26464f73ed7b6163815495a509ffd3 (diff) | |
download | ydb-a18f18d81996ca8e681bb6cabd441b52833d99bf.tar.gz |
Add fallback to ssl port on ydb driver init (#11869)
-rw-r--r-- | ydb/core/driver_lib/run/run.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ydb/core/driver_lib/run/run.cpp b/ydb/core/driver_lib/run/run.cpp index dafe627e72..7680f911eb 100644 --- a/ydb/core/driver_lib/run/run.cpp +++ b/ydb/core/driver_lib/run/run.cpp @@ -1428,8 +1428,14 @@ void TKikimrRunner::InitializeActorSystem( } if (runConfig.AppConfig.HasGRpcConfig()) { - if (const ui32 grpcPort = runConfig.AppConfig.GetGRpcConfig().GetPort()) { - auto driverConfig = NYdb::TDriverConfig().SetEndpoint(TStringBuilder() << "localhost:" << grpcPort); + ui32 port = runConfig.AppConfig.GetGRpcConfig().GetPort(); + + if (!port) { + port = runConfig.AppConfig.GetGRpcConfig().GetSslPort(); + } + + if (port) { + auto driverConfig = NYdb::TDriverConfig().SetEndpoint(TStringBuilder() << "localhost:" << port); YdbDriver.Reset(new NYdb::TDriver(driverConfig)); AppData->YdbDriver = YdbDriver.Get(); } |