Skip to content

Commit c7fcad4

Browse files
committed
Support in ydbd and legacy grpc service calls
1 parent f0192f8 commit c7fcad4

File tree

6 files changed

+16
-2
lines changed

6 files changed

+16
-2
lines changed

ydb/core/driver_lib/cli_base/cli_cmds_db.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,8 @@ class TClientCommandSchemaTableOptions : public TClientCommand {
825825
ClientConfig.MaxInFlight = CommandConfig.ClientConfig.MaxInFlight;
826826
ClientConfig.EnableSsl = CommandConfig.ClientConfig.EnableSsl;
827827
ClientConfig.SslCredentials.pem_root_certs = CommandConfig.ClientConfig.SslCredentials.pem_root_certs;
828+
ClientConfig.SslCredentials.pem_cert_chain = CommandConfig.ClientConfig.SslCredentials.pem_cert_chain;
829+
ClientConfig.SslCredentials.pem_private_key = CommandConfig.ClientConfig.SslCredentials.pem_private_key;
828830
}
829831

830832
template<typename T>

ydb/core/driver_lib/cli_base/cli_cmds_root.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ class TClientCommandRootLite : public TClientCommandRootKikimrBase {
194194
if (config.EnableSsl) {
195195
CommandConfig.ClientConfig.EnableSsl = config.EnableSsl;
196196
CommandConfig.ClientConfig.SslCredentials.pem_root_certs = config.CaCerts;
197+
if (config.ClientCert) {
198+
CommandConfig.ClientConfig.SslCredentials.pem_cert_chain = config.ClientCert;
199+
CommandConfig.ClientConfig.SslCredentials.pem_private_key = config.ClientCertPrivateKey;
200+
}
197201
}
198202
}
199203

ydb/core/driver_lib/cli_base/cli_grpc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ class TClientGRpcCommand : public TClientCommand {
9494
ClientConfig.MaxInFlight = CommandConfig.ClientConfig.MaxInFlight;
9595
ClientConfig.EnableSsl = CommandConfig.ClientConfig.EnableSsl;
9696
ClientConfig.SslCredentials.pem_root_certs = CommandConfig.ClientConfig.SslCredentials.pem_root_certs;
97+
ClientConfig.SslCredentials.pem_cert_chain = CommandConfig.ClientConfig.SslCredentials.pem_cert_chain;
98+
ClientConfig.SslCredentials.pem_private_key = CommandConfig.ClientConfig.SslCredentials.pem_private_key;
9799
}
98100

99101
static int PrepareConfigCredentials(NGRpcProxy::TGRpcClientConfig clientConfig, TConfig& commandConfig) {
@@ -159,4 +161,3 @@ class TClientGRpcCommand : public TClientCommand {
159161

160162
}
161163
}
162-

ydb/core/driver_lib/cli_utils/cli_cmds_root.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ class TClientCommandRoot : public TClientCommandRootKikimrBase {
6262
if (config.EnableSsl) {
6363
CommandConfig.ClientConfig.EnableSsl = config.EnableSsl;
6464
CommandConfig.ClientConfig.SslCredentials.pem_root_certs = config.CaCerts;
65+
if (config.ClientCert) {
66+
CommandConfig.ClientConfig.SslCredentials.pem_cert_chain = config.ClientCert;
67+
CommandConfig.ClientConfig.SslCredentials.pem_private_key = config.ClientCertPrivateKey;
68+
}
6569
}
6670
}
6771
};

ydb/core/driver_lib/cli_utils/cli_cmds_tenant.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ class TTenantClientGRpcCommand : public TTenantClientCommand {
142142
ClientConfig.MaxInFlight = CommandConfig.ClientConfig.MaxInFlight;
143143
ClientConfig.EnableSsl = CommandConfig.ClientConfig.EnableSsl;
144144
ClientConfig.SslCredentials.pem_root_certs = CommandConfig.ClientConfig.SslCredentials.pem_root_certs;
145+
ClientConfig.SslCredentials.pem_cert_chain = CommandConfig.ClientConfig.SslCredentials.pem_cert_chain;
146+
ClientConfig.SslCredentials.pem_private_key = CommandConfig.ClientConfig.SslCredentials.pem_private_key;
145147
}
146148

147149
int Run(TConfig &config) override

ydb/core/driver_lib/run/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ int MainRun(const TKikimrRunConfig& runConfig, std::shared_ptr<TModuleFactories>
9090
NMsgBusProxy::TMsgBusClientConfig mbusConfig;
9191
mbusConfig.ConfigureLastGetopt(opts, "mb-");
9292
opts.AddLongOption("ca-file", "Path to a file containing the PEM encoding of the server root certificates for tls connections.\n").RequiredArgument("PATH");
93+
opts.AddLongOption("client-cert-file", "Path to a file containing the PEM encoding of the client certificate for tls connections.\n").RequiredArgument("PATH");
94+
opts.AddLongOption("client-cert-key-file", "Path to a file containing the PEM encoding of the client certificate private key for tls connections.\n").RequiredArgument("PATH");
9395
NDriverClient::HideOptions(opts);
9496
opts.AddLongOption('s', "server", "Server address to connect (default $KIKIMR_SERVER)").RequiredArgument("ADDR[:NUM]");
9597
opts.AddLongOption('k', "token", "Security token").RequiredArgument("TOKEN");
@@ -205,4 +207,3 @@ int ParameterizedMain(int argc, char **argv, std::shared_ptr<NKikimr::TModuleFac
205207
return 1;
206208
}
207209
}
208-

0 commit comments

Comments
 (0)