aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorInnokentii Mokin <innokentii@ydb.tech>2024-11-22 12:09:34 +0300
committerGitHub <noreply@github.com>2024-11-22 12:09:34 +0300
commita18f18d81996ca8e681bb6cabd441b52833d99bf (patch)
tree7c083d8be0cc054778791f4a177b5a767e356e9f
parentb7cfb3622d26464f73ed7b6163815495a509ffd3 (diff)
downloadydb-a18f18d81996ca8e681bb6cabd441b52833d99bf.tar.gz
Add fallback to ssl port on ydb driver init (#11869)
-rw-r--r--ydb/core/driver_lib/run/run.cpp10
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();
}