Skip to content

Commit a18f18d

Browse files
authored
Add fallback to ssl port on ydb driver init (#11869)
1 parent b7cfb36 commit a18f18d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ydb/core/driver_lib/run/run.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,8 +1428,14 @@ void TKikimrRunner::InitializeActorSystem(
14281428
}
14291429

14301430
if (runConfig.AppConfig.HasGRpcConfig()) {
1431-
if (const ui32 grpcPort = runConfig.AppConfig.GetGRpcConfig().GetPort()) {
1432-
auto driverConfig = NYdb::TDriverConfig().SetEndpoint(TStringBuilder() << "localhost:" << grpcPort);
1431+
ui32 port = runConfig.AppConfig.GetGRpcConfig().GetPort();
1432+
1433+
if (!port) {
1434+
port = runConfig.AppConfig.GetGRpcConfig().GetSslPort();
1435+
}
1436+
1437+
if (port) {
1438+
auto driverConfig = NYdb::TDriverConfig().SetEndpoint(TStringBuilder() << "localhost:" << port);
14331439
YdbDriver.Reset(new NYdb::TDriver(driverConfig));
14341440
AppData->YdbDriver = YdbDriver.Get();
14351441
}

0 commit comments

Comments
 (0)