Skip to content

Re-add DoH support to gRPC transport#1776

Merged
hulto merged 3 commits intoupdate-tonicfrom
re-add-doh-grpc-10726710501313335308
Feb 8, 2026
Merged

Re-add DoH support to gRPC transport#1776
hulto merged 3 commits intoupdate-tonicfrom
re-add-doh-grpc-10726710501313335308

Conversation

@hulto
Copy link
Copy Markdown
Collaborator

@hulto hulto commented Feb 8, 2026

Re-added DNS-over-HTTPS (DoH) support to the gRPC transport. This was previously disabled due to the migration to Hyper 1.x. The implementation includes a new HickoryResolverServiceHyper1 struct that bridges hickory-resolver with the tower::Service trait used by hyper-util's legacy connector. The gRPC transport now extracts the doh provider from the configuration metadata and initializes the appropriate connector. Unit tests have been added to verify the new components.


PR created automatically by Jules for task 10726710501313335308 started by @hulto

- Implement `HickoryResolverServiceHyper1` in `dns_resolver.rs` to support `tower::Service` as required by `hyper-util` 0.1.
- Integrate the new DoH resolver into `grpc.rs`.
- Add unit tests for the new Hyper 1.x DoH components.
- Ensure compatibility with existing `hyper_legacy` (hyper 0.14) based transports.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules bot and others added 2 commits February 8, 2026 18:50
- Implement `HickoryResolverServiceHyper1` in `dns_resolver.rs` to support `tower::Service` as required by `hyper-util` 0.1.
- Integrate the new DoH resolver into `grpc.rs`.
- Fix HTTPS support in gRPC transport by wrapping the connector in `hyper-rustls` `HttpsConnector`, which is necessary when using custom connectors with `tonic` 0.14 and HTTPS URIs.
- Explicitly configure `rustls` with the `ring` crypto provider to avoid ambiguity and ensure compatibility with other crates in the workspace.
- Update `Cargo.toml` with `hyper-rustls` and `rustls` dependencies.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
- Implement `HickoryResolverServiceHyper1` in `dns_resolver.rs` to support `tower::Service` as required by `hyper-util` 0.1 (Hyper 1.x).
- Integrate the new DoH resolver into `grpc.rs`.
- Implement `ForceHttpsConnector` workaround in `grpc.rs` to bypass `tonic` 0.14's strict scheme check for `https://` URIs when using custom connectors.
- Explicitly configure `rustls` with the `ring` crypto provider to ensure a default provider is available.
- Update `Cargo.toml` with `hyper-rustls`, `rustls`, and necessary features.
- Restore unit tests for DoH and add verification for Hyper 1.x components.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>
@hulto hulto merged commit 84d84b5 into update-tonic Feb 8, 2026
@hulto hulto deleted the re-add-doh-grpc-10726710501313335308 branch February 8, 2026 23:51
hulto added a commit that referenced this pull request Feb 14, 2026
* Update tonic to v0.14.3 and migrate to tonic-prost-build

This commit updates the tonic gRPC framework to the latest version (0.14.3)
and migrates the build system to use tonic-prost-build, which is required
for the new API.

## Key Changes

### Dependency Updates
- Migrated from `tonic-build` to `tonic-prost-build` v0.14.3
- Updated hyper proxy support:
  - gRPC transport: hyper-http-proxy 1.1.0 (hyper 1.x compatible)
  - HTTP/1.1 transport: hyper-proxy 0.9.1 as hyper-proxy-legacy (hyper 0.14)
- Added supporting dependencies: http, tower, hyper-util, http-body-util

### API Migrations
- **build.rs**: Replaced `tonic_build::configure()` with `tonic_prost_build::configure()`
  and `.compile()` with `.compile_protos()`
- **grpc.rs**: Updated to use hyper-http-proxy for hyper 1.x compatibility
- **http.rs**: Migrated to hyper_legacy namespace to maintain hyper 0.14 for HTTP/1.1
- **dns_resolver.rs**: Updated DNS-over-HTTPS resolver to use hyper_legacy types

### Code Quality
- Fixed unused import warnings
- Fixed unnecessary mut warning in dns.rs
- Regenerated all proto files with new tonic-prost-build

## Testing
- 78/79 tests passing
- 1 pre-existing test failure in pb::config unrelated to tonic upgrade
- Workspace compiles cleanly with cargo check

## Notes
- HTTP/1.1 transport continues using hyper 0.14 for stability
- gRPC transport now uses hyper 1.x via tonic 0.14.3
- DOH support temporarily disabled for gRPC pending hyper 1.x DNS resolver

Generated with [Claude Code](https://claude.com/claude-code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>

* del dead code

* Re-add DoH support to gRPC transport (#1776)

* Re-add DoH support to the grpc.rs transport

- Implement `HickoryResolverServiceHyper1` in `dns_resolver.rs` to support `tower::Service` as required by `hyper-util` 0.1.
- Integrate the new DoH resolver into `grpc.rs`.
- Add unit tests for the new Hyper 1.x DoH components.
- Ensure compatibility with existing `hyper_legacy` (hyper 0.14) based transports.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>

* Re-add DoH support to the grpc.rs transport and fix HTTPS support

- Implement `HickoryResolverServiceHyper1` in `dns_resolver.rs` to support `tower::Service` as required by `hyper-util` 0.1.
- Integrate the new DoH resolver into `grpc.rs`.
- Fix HTTPS support in gRPC transport by wrapping the connector in `hyper-rustls` `HttpsConnector`, which is necessary when using custom connectors with `tonic` 0.14 and HTTPS URIs.
- Explicitly configure `rustls` with the `ring` crypto provider to avoid ambiguity and ensure compatibility with other crates in the workspace.
- Update `Cargo.toml` with `hyper-rustls` and `rustls` dependencies.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>

* Re-add DoH support to the grpc.rs transport and fix HTTPS support

- Implement `HickoryResolverServiceHyper1` in `dns_resolver.rs` to support `tower::Service` as required by `hyper-util` 0.1 (Hyper 1.x).
- Integrate the new DoH resolver into `grpc.rs`.
- Implement `ForceHttpsConnector` workaround in `grpc.rs` to bypass `tonic` 0.14's strict scheme check for `https://` URIs when using custom connectors.
- Explicitly configure `rustls` with the `ring` crypto provider to ensure a default provider is available.
- Update `Cargo.toml` with `hyper-rustls`, `rustls`, and necessary features.
- Restore unit tests for DoH and add verification for Hyper 1.x components.

Co-authored-by: hulto <7121375+hulto@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>

* fmt

* safely default to cloudflare

* Update crate

* Disable cert checking (#1779)

* Disable cert checking

* fix http1 callback URI

* Refactor ignore certs

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Happy <yesreply@happy.engineering>
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: KCarretto <Kcarretto@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant