无法从Golang客户端调用grpc asp.net服务

时间:2020-09-23 00:13:45

标签: asp.net-core go grpc

我在尝试调用运行在Google Cloud Run托管的ASP.NET Core服务器上的gRPC服务时遇到问题。这是 Program.cs

mysql> load xml local infile 'C:/Users/install/Desktop/test.xml' into table users rows identified by '<row>';
ERROR 2068 (HY000): LOAD DATA LOCAL INFILE file request rejected due to restrictions on access.

mysql> load xml infile 'C:/Users/install/Desktop/test.xml' into table users rows identified by '<row>';
ERROR 29 (HY000): File 'C:\Users\install\Desktop\test.xml' not found (OS errno 13 - Permission denied)

这里是Golang客户端:

return Host.CreateDefaultBuilder(args)
            .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.UseStartup<Startup>();
                webBuilder.UseKestrel(kestrel =>
                {
                    kestrel.ConfigureHttpsDefaults(o =>
                        {
                            o.AllowAnyClientCertificate();
                            o.ClientCertificateMode = ClientCertificateMode.NoCertificate;
                        });
                        kestrel.ListenAnyIP(port, configure =>
                        {
                            configure.Protocols = HttpProtocols.Http2;
                        });
                });
            })
            .UseSerilog();

当我向我的应用程序发出请求时(由于Golang项目也是托管在Google Cloud上的小型Web服务器,它会接收HTTP请求并发送到gRPC服务。),将引发以下错误:

conn, err := grpc.Dial("myserver.run.app:443", grpc.WithInsecure()) if err != nil { log.Fatalf("Failed to dial: %v", err) } defer conn.Close() identityClient = pb.NewIdentityRpcClient(conn) ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() response, err := identityClient.VerifyEmail(ctx, &pb.VerifyEmailRequest{ Code: token, UserId: userID, Email: "", }) if err != nil { log.Fatalf("%v.verifyEmail(_) = _, %v", identityClient, err) return false }

并且没有提供任何信息。知道发生了什么吗?我无法使用安全凭据,因为我没有SSL证书,并且我的服务器也没有证书。

0 个答案:

没有答案