File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
ydb/library/yql/providers Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -595,6 +595,11 @@ message TGenericConnectorConfig {
595595 // If true, GRPC Client will use TLS encryption.
596596 // Server cert will be verified with system CA cert pool.
597597 optional bool UseSsl = 4 ;
598+ // Path to the custom CA certificate that was used
599+ // during Connector key pair issuing.
600+ // If empty, the default system root certificates will be used
601+ // to verify Connector's cert.
602+ optional string SslCaCrt = 5 ;
598603
599604 reserved 1 , 2 ;
600605}
Original file line number Diff line number Diff line change 1+ #include < util/stream/file.h>
2+
13#include " client.h"
24
35namespace NYql ::NConnector {
@@ -21,10 +23,18 @@ namespace NYql::NConnector {
2123 public:
2224 TClientGRPC () = delete ;
2325 TClientGRPC (const TGenericConnectorConfig& config) {
24- TString endpoint = TStringBuilder () << config. GetEndpoint (). host () << " : " << ToString (config. GetEndpoint (). port () );
25- GrpcConfig_ = NYdbGrpc::TGRpcClientConfig (endpoint) ;
26+ GrpcConfig_ = NYdbGrpc::TGRpcClientConfig ( );
27+ GrpcConfig_. Locator = TStringBuilder () << config. GetEndpoint (). host () << " : " << ToString (config. GetEndpoint (). port ()); ;
2628 GrpcConfig_.EnableSsl = config.GetUseSsl ();
2729
30+ // Read content of CA cert
31+ TString rootCertData;
32+ if (config.GetSslCaCrt ()) {
33+ rootCertData = TFileInput (config.GetSslCaCrt ()).ReadAll ();
34+ }
35+
36+ GrpcConfig_.SslCredentials = grpc::SslCredentialsOptions{.pem_root_certs = rootCertData, .pem_private_key = " " , .pem_cert_chain = " " };
37+
2838 GrpcClient_ = std::make_unique<NYdbGrpc::TGRpcClientLow>();
2939
3040 // FIXME: is it OK to use single connection during the client lifetime?
You can’t perform that action at this time.
0 commit comments