Wenn du den Skeletal-Code benötigst, wende dich an einen Google-POC.
Server ohne TLS testen
Für die ersten Tests kann TLS deaktiviert werden:
$cd[base_dir]$rubyserver.rb--disable_tls
Dies ist für die Produktion nicht geeignet.
Produktionszertifikate konfigurieren
Um TLS auf dem Server zu aktivieren, sind die folgenden Dateien erforderlich:
certificates/server.pem die Zertifikatskette für den Server im PEM-Format
certificates/server.key den privaten Schlüssel für die Serverzertifikatskette
certificates/trusted_client_roots.pem die Root-Zertifikate, die bei der Authentifizierung von Clients als vertrauenswürdig eingestuft werden
Die vertrauenswürdigen Client-Root-Zertifikate werden bei der Authentifizierung des Clients verwendet. Sie können diese vertrauenswürdigen Stammzertifikate von einer Zertifizierungsstelle wie Mozilla beziehen oder die derzeit von der Google Internet Authority G2 empfohlenen Stammzertifikate installieren. In letzterem Fall müssen Sie das Root-Zertifikat möglicherweise manuell aktualisieren.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-05-26 (UTC)."],[[["This guide outlines the necessary steps to set up a Ruby-based gRPC server, including the required gems: `google-protobuf` and `grpc`."],["You'll need to download the service definition file (`booking_service.proto`) and organize it within a specific directory structure that includes `certificates`, `lib`, `protos`, and `server.rb`."],["Generating the necessary Ruby libraries from the service definition file using the `grpc_tools_ruby_protoc` command is required to implement the server."],["The server can be initially tested without TLS using the command `ruby server.rb --disable_tls`, but this is not recommended for production environments."],["Enabling TLS in production requires configuring the server with `server.pem`, `server.key`, and `trusted_client_roots.pem` files within the `certificates` directory, to ensure secure communication."]]],["The implementation requires the `google-protobuf` and `grpc` gems. Download the service definition, create the specified directory structure, and generate Ruby libraries using `grpc_tools_ruby_protoc`. TLS can be initially disabled using `--disable_tls` for testing. Production requires `server.pem`, `server.key`, and `trusted_client_roots.pem` within the certificates directory for TLS. The `trusted_client_roots.pem` may come from an authority like Mozilla or Google Internet Authority G2.\n"]]