[PR #2004] [MERGED] fix: gRPC/HTTP2 negotiation by enabling h2 protocol in TLS configEnable HTTP/2 #2009

Closed
opened 2026-03-03 12:37:13 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fsouza/fake-gcs-server/pull/2004
Author: @RageZBla
Created: 8/19/2025
Status: Merged
Merged: 8/25/2025
Merged by: @fsouza

Base: mainHead: HTTP-2-PRI


📝 Commits (1)

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 main.go (+1 -0)

📄 Description

Problem

gRPC requests were failing with 404 errors because the server couldn't negotiate HTTP/2 connections properly.

Solution

Added tlsConfig.NextProtos = []string{"h2"} to enable HTTP/2 protocol negotiation in the TLS configuration.

Testing

# Start server
$ go run main.go -scheme both -backend memory

# Test gRPC (now works)
$ grpcurl -insecure 127.0.0.1:4443 google.storage.v1.Storage.ListBuckets
{}

Before

logs:

time=2025-08-19T20:56:37.822+09:00 level=INFO msg="::1 - - [19/Aug/2025:20:56:37 +0900] \"PRI * HTTP/2.0\" 404 19\n"

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fsouza/fake-gcs-server/pull/2004 **Author:** [@RageZBla](https://github.com/RageZBla) **Created:** 8/19/2025 **Status:** ✅ Merged **Merged:** 8/25/2025 **Merged by:** [@fsouza](https://github.com/fsouza) **Base:** `main` ← **Head:** `HTTP-2-PRI` --- ### 📝 Commits (1) - [`740b1ea`](https://github.com/fsouza/fake-gcs-server/commit/740b1eaba7021eb6692e1884385b6ebba59a3e40) Enable HTTP/2 ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `main.go` (+1 -0) </details> ### 📄 Description ## Problem gRPC requests were failing with 404 errors because the server couldn't negotiate HTTP/2 connections properly. ## Solution Added `tlsConfig.NextProtos = []string{"h2"}` to enable HTTP/2 protocol negotiation in the TLS configuration. ## Testing ```shell # Start server $ go run main.go -scheme both -backend memory # Test gRPC (now works) $ grpcurl -insecure 127.0.0.1:4443 google.storage.v1.Storage.ListBuckets {} ``` ## Before logs: ``` time=2025-08-19T20:56:37.822+09:00 level=INFO msg="::1 - - [19/Aug/2025:20:56:37 +0900] \"PRI * HTTP/2.0\" 404 19\n" ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 12:37:13 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#2009
No description provided.