当前位置: 首页 > 知识库问答 >
问题:

如何在 Asylo 的 GrPC 服务器配置中写入服务器地址?

郎伟兆
2023-03-14

我正在尝试让这个gRPC服务器示例与Google Asylo(https://github.com/google/asylo/tree/master/asylo/examples/grpc_server)一起工作。.要初始化服务器,我需要在此配置文件中指定server_address(https://github.com/google/asylo/blob/master/asylo/examples/grpc_server/grpc_server_config.proto)

示例中的服务器地址是这样写的:

/ The address that the gRPC server inside the enclave will be hosted on.
 // Required.
optional string server_address = 205739939;

我不确定该地址的格式(即,是IPv4还是Ipv6)。当我尝试示例中的地址时,它会给出以下错误:

E0415 20:26:28.102505429 139772652978128 server_chttp2.cc:40] {“created”:“@1555359988.102435497”,“description”:“external/com_github_grpc_grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc”,“file_line”:348,“referenced_errors”:[{“created”:“@1555359988.102435497”,“description”:“协议系列不支持”errno“:106,”file“:”external/com_github_grpc_grpc/src/core/lib/iomgr/socket_utils_common_posix.cc“,”file_line“:379,”os_error“:”协议系列不支持的地址系列“,”syscall“:”socket“,”target_address“:”[:1]:0“}]} 2019-04-15 20:26:28 FATAL grpc_server_driver.cc : 62 : 加载grpc_server/grpc_server_enclave.so 失败: ::asylo::error::GoogleErrorSpace::Internal: 无法启动服务器

我想写Ipv4地址,例如:127.0.0.1:5000,但我做不到。有什么指点者不胜感激?

共有1个答案

吴缪文
2023-03-14

@Tarek Elgamal

.proto 文件不是放置 IP 地址的位置。server_address是 .proto 消息定义中的一个字段,用于受信任的应用程序与不受信任的应用程序之间的通信

<code>可选字符串server_address=205739939

示例的 IP 地址设置在 grpc_server_driver.cc 的以下第 34 行

该值通过grpc_server_driver第47行的配置传递给信任应用程序。

受信任的应用程序将分解。enclave管理器在enclave初始化方法期间发送的proto消息。

asylo::Status GrpcServerEnclave::Initialize(
    const asylo::EnclaveConfig &enclave_config) LOCKS_EXCLUDED(server_mutex_) {
  // Fail if there is no server_address available.
  if (!enclave_config.HasExtension(server_address)) {
    return asylo::Status(asylo::error::GoogleError::INVALID_ARGUMENT,
                         "Expected a server_address extension on config.");
  }
 类似资料:
  • 配置服务器最好作为独立应用程序运行,但如果需要,可以将其嵌入到另一个应用程序中。只需使用@EnableConfigServer注释。在这种情况下可以使用的可选属性是spring.cloud.config.server.bootstrap,它是一个标志,表示服务器应该从其自己的远程存储库配置自身。该标志默认关闭,因为它可能会延迟启动,但是当嵌入在另一个应用程序中时,以与其他应用程序相同的方式初始化是

  • 我们来看看如何配置服务器端的 SSH 访问。 本例中,我们将使用 authorized_keys 方法来对用户进行认证。 同时我们假设你使用的操作系统是标准的 Linux 发行版,比如 Ubuntu。 首先,创建一个操作系统用户 git,并为其建立一个 .ssh 目录。 $ sudo adduser git $ su git $ cd $ mkdir .ssh && chmod 700 .ssh

  • 服务器配置 当你需要一台服务器的时候,首先需要向你的leader 提出申请,你的 leader 会利用公司的阿里云账户购买服务器实例,并且会把服务器的公网IP以及账号密码发送给你。 以下章节就叙述了当拿到一台全新的阿里云服务器实例时,我们需要怎样的工具以及我们需要经历哪些步骤对服务器进行配置。

  • 我们来看看如何配置服务器端的 SSH 访问。 本例中,我们将使用 authorized_keys 方法来对用户进行认证。 同时我们假设你使用的操作系统是标准的 Linux 发行版,比如 Ubuntu。 首先,创建一个操作系统用户 git,并为其建立一个 .ssh 目录。 $ sudo adduser git $ su git $ cd $ mkdir .ssh && chmod 700 .ssh

  • 我正在使用Eclipse Juno,并且通过windows安装程序在我的PC中安装了Apache Tomcat/8.0.0-RC5。当我尝试在Eclipse中定义新服务器时,在Apache下,我没有Tomcat v8.0选项。它在Tomcat v7.0停止。如何让Apache Tomcat v8.0在Eclipse中运行?

  • 我正在使用收集器跟踪java服务中的跨度,这一服务是http和grpc。收集器终结点是localhost:55680。此java服务跟踪成功。 现在,我想使用这个收集器基于gRPC跟踪我的go服务。 在我的go服务中,我复制以下文件:interceptor。去grpctrace。从repo opentelemetry转到contrib,这里https://github.com/open-telem