• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

grpc / grpc-java / #20170
89%

Build:
DEFAULT BRANCH: master
Ran 09 Feb 2026 10:58AM UTC
Jobs 1
Files 628
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Feb 2026 10:46AM UTC coverage: 88.695% (+0.001%) from 88.694%
#20170

push

github

web-flow
fix(xds): Allow and normalize trailing dot (FQDN) in matchHostName (#12644)

## Summary

`matchHostName` in `RoutingUtils` and `XdsNameResolver` currently
rejects hostnames and patterns
with a trailing dot (`.`) via `checkArgument`. A trailing dot denotes a
**Fully Qualified Domain Name (FQDN)** as defined in
[RFC 1034 Section
3.1](https://www.rfc-editor.org/rfc/rfc1034#section-3.1), and is a
valid,
well-defined representation of an absolute domain name. Rejecting it is
inconsistent with the RFC.

This change removes the trailing-dot rejection and adds normalization to
strip the trailing dot
before matching, making `example.com.` and `example.com` match
equivalently.

## Background

Per [RFC 1034 Section
3.1](https://www.rfc-editor.org/rfc/rfc1034#section-3.1):

> "If the name ends with a dot, it is an absolute name ... For example,
`poneria.ISI.EDU.`"

A trailing dot simply indicates that the name is rooted at the DNS root
and is semantically
equivalent to the same name without the trailing dot. Treating it as
invalid prevents legitimate
FQDNs from being used as hostnames or virtual host domain patterns in
xDS routing configuration.

## Motivation

This was discovered when using gRPC Proxyless Service Mesh on a
Kubernetes cluster with Istio.
The issue surfaced after upgrading Istio from 1.26.8 to 1.28.3. The
Istio change
[istio/istio#56008](https://github.com/istio/istio/pull/56008) began
sending FQDN-style domain
names (with trailing dots) in xDS route configuration, which caused
grpc-java to throw an
`IllegalArgumentException` in `matchHostName`:

```text
java.lang.IllegalArgumentException: Invalid pattern/domain name
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:143)
```

The root cause is that grpc-java's `matchHostName` was not RFC-compliant
in rejecting trailing dots — the Istio upgrade merely made it visible.
The fix here is to bring grpc-java into compliance with RFC 1034,
independent of any specific Istio versi... (continued)

35391 of 39902 relevant lines covered (88.69%)

0.89 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
93.21
-0.14% ../okhttp/src/main/java/io/grpc/okhttp/OkHttpClientTransport.java
1
87.6
-0.83% ../rls/src/main/java/io/grpc/rls/LinkedHashLruCache.java
1
74.14
-0.86% ../servlet/src/main/java/io/grpc/servlet/ServletServerStream.java
1
96.55
-1.72% ../xds/src/main/java/io/grpc/xds/internal/security/certprovider/CertificateProvider.java
2
87.75
-0.79% ../core/src/main/java/io/grpc/internal/DelayedClientCall.java
3
95.05
-0.44% ../core/src/main/java/io/grpc/internal/RetriableStream.java
3
94.59
1.74% ../xds/src/main/java/io/grpc/xds/RoutingUtils.java
38
92.11
0.27% ../xds/src/main/java/io/grpc/xds/XdsNameResolver.java
Jobs
ID Job ID Ran Files Coverage
1 #20170.1 09 Feb 2026 10:58AM UTC 628
88.69
Source Files on build #20170
  • Tree
  • List 628
  • Changed 11
  • Source Changed 0
  • Coverage Changed 11
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #20170
  • 0ef1b392 on github
  • Prev Build on master
  • Next Build on master
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc