コンソールアプリケーションの下に書いたために、c#.netを使用してtls対応のdgraphサーバーに接続しようとし ています
class DGraphClient
{
public IDgraphClient GetDgraphClient()
{
GraphSchemaIOConnection ConnectionConfig1 = new GraphSchemaIOConnection();
ConnectionConfig1.Endpoint = "testdgraph.abc.tech:9080";
DgraphInstance GSioDgraph = new DgraphInstance();
DgraphCertificates certificates = new DgraphCertificates();
certificates.CaCert = "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURVekNDQWp1Z0F3SUJBZ0lJR1dnMnhpbzVMYVl3RFFZSktvWklodmNOQVFFTEJRQXdSakVhTUJnR0ExVUUKQ2hNUlJHZHlZWEJvSUV4aFluTXNJRWx1WXk0eEZ6QVZCZ05WQkFNVERrUm5jbUZ3YUNCU2IyOTBJRU5CTVE4dwpEUVlEVlFRRkV3WXhPVFk0TXpZd0hoY05NakV3TWpJeU1EWXpORFU0V2hjTk16RXdNakl5TURZek5EVTRXakJHCk1Sb3dHQVlEVlFRS0V4RkVaM0poY0dnZ1RHRmljeXdnU1c1akxqRVhNQlVHQTFVRUF4TU9SR2R5WVhCb0lGSnYKYjNRZ1EwRXhEekFOQmdOVkJBVVRCakU1Tmpnek5qQ0NBU0l3RFFZSktvWklodmNOQVFFQkJRQURnZ0VQQURDQwpBUW9DZ2dFQkFNeTV4RHN4eXhoTVpUM01TMGplcS9qOGFMM2tCZHZWcmNSS2lTUjY5MFZ1L2xKREk1Zm5tdHduCjN2WWxNbXQyNEVmQ0x4Rzk2S3dqZ3ZVZlBNZFI3WGM2RFFlUWpmanA1TXBaV2VwMzdxWTVURExLcC9YNEF0WUIKcU5reVlQSFo4R1BYOVN1Zk9jSk5vdUZtWStpeDY5L2VkTlpMczA5SC93STd4dDlpREExTzBQVVQ1Z00yZi9vLwp5d2Rpb2J0S3dpNmszY2VxTTRPZ2dLUE92d0k2K0ViOE9TM0wwZ3VIQ05IaHJxM3VjblJKeE5yaWZvNnNoTEhECkdXQ3BRbXRWZDM0azVsY3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1c0SWhUM09GNVBXZDUxY3NoNUtManQzaE1XYlZMQS9nVzZCaXRvbXJHY2FDL3B0UG8zMAp4NUtqZVh5emhvY3VxLzloWVF2NVdlV2plZXU1MXNvQzgzcEhiRnFibUhEaDdyUTMwcmhMUCtyMTBjZmxaVUdaCnJ2aWtFd0tCZ0QzbjJSNDNHQWZlTnV6V25NZEtDT3BXWTJVQVZHdG5Tbmx2bWhDcHVLM0hnVmV4RGd6d0g1U0YKeG9kNE04U1pBV3lNSGxBcGx2VEFrWE9JWGdHYjgrQVl5aklPVVMybTZocHFlMk1neVZobGZuWFIxeWwrUXJiNwovY0FsN3RpR0kvcmJDZFYvVFpLTVJHN0ZyUVFUK0p2NFErbTlKT0EwNldWMTYrTU5ZNXAwCi0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg";
GSioDgraph.Certificates = certificates;
GSioDgraph.Address = "testdgraph.abc.tech:9080";
if (ConnectionConfig1.Endpoint.Equals("localhost"))
{
var client = DgraphDotNet.Clients.NewDgraphClient();
client.Connect("");
return client;
}
else
{
var client = DgraphDotNet.Clients.NewDgraphClient();
var caCert = GSioDgraph.Certificates.CaCert;
var clientCert = GSioDgraph.Certificates.ClientCert;
var clientKey = GSioDgraph.Certificates.ClientKey;
var tls = new SslCredentials(caCert, new KeyCertificatePair(clientCert, clientKey));
client.Connect(GSioDgraph.Address, tls);
// var result = client.CheckVersion();
return client;
}
}
以下のコードを使用してチェックバージョンを呼び出す
DGraphClient dc = new DGraphClient();
try
{
var dgraphClient = dc.GetDgraphClient();
var result1 = await dgraphClient.CheckVersion();
if (result1.IsSuccess)
{
Console.WriteLine("Connected to Dgraph version {Version}", result1.Value);
}
var res = await dgraphClient.Query(query);//.NewTransaction().Query(query);
if (res.IsFailed)
{
Console.WriteLine("ERROR THROWING");
}
result = res.Value;
await dgraphClient.NewTransaction().Commit();
}
catch (Exception ex)
{
throw ex;
}
クライアントをインスタンス化した後、サーバーのバージョンをチェックして、接続されていることを確認していますが、grpcで失敗しました {Result: IsSuccess='False', Reasons='ExceptionalError with Message='Status(StatusCode=Unavailable, Detail="Empty update")', Exception='Grpc.Core.RpcException: Status(StatusCode=Unavailable, Detail="Empty update")\r\n at DgraphDotNet.GRPCConnection.CheckVersion()\r\n at DgraphDotNet.DgraphClient.CheckVersion()'', }