Commit Graph

15 Commits

Author SHA1 Message Date
bcleenders
13ca681bad Add support for TLS 1.3
This PR allows TLS 1.3, by removing the MaxVersion in the client config.

This would silently swallow errors, so e.g. a client without cert
dialing a server that requires client certs would lead to an error which
gets ignored, leading to retries until timeout.

In this PR, we wrap the connection and if an error occurs we send it to
the existing `result` channel.

I think this matches @jhump's comment in https://github.com/fullstorydev/grpcurl/issues/387#issuecomment-1517098394

 **Testing**

```console
 # Start the test server (in another tab)
go run ./internal/testing/cmd/testserver \
    -cert internal/testing/tls/server.crt \
    -key internal/testing/tls/server.key \
    -cacert internal/testing/tls/ca.crt \
    -requirecert -p 9999

 # Old behavior
$ grpcurl -cacert internal/testing/tls/ca.crt \
    localhost:9999 list
Failed to dial target host "localhost:9999": context deadline exceeded

 # New behavior
$ go run ./cmd/grpcurl -cacert internal/testing/tls/ca.crt \
    localhost:9999 list
Failed to dial target host "localhost:9999": remote error: tls: certificate required
exit status 1
```

The old behavior is to hang until we hit the deadline. The new behavior
is to return immediately with an error.

Fixes #563
2026-06-06 15:36:00 +02:00
Mikel Olasagasti Uranga
7ad93a42d9 test: Update TLS error checks for Go 1.25 compatibility (#522)
The error message for client certificate failures changed in Go 1.25.
Update tests to check for both the old ("bad certificate") and new
("handshake failure") error strings to support multiple Go versions.

Signed-off-by: Mikel Olasagasti Uranga <mikel@olasagasti.info>
2025-07-24 18:11:12 -04:00
Valters Jansons
743e60a4c9 Run tests on Go 1.21 (#408)
* Run tests on Go 1.21

For the most part, there are no breaking changes.

However, the expired certificate is now showing "expired certificate"
although previously it showed a simpler "bad certificate" which was
hard-coded into the TLS settings test scenario.

* Simplify condition for certificate error

Instead of two `expired certificate` and `bad certificate` comparisons, we can just check for `certificate` in error output. This satisfies us when checking there is something wrong with the certificate.

Co-authored-by: Scott Blum <dragonsinth@gmail.com>

---------

Co-authored-by: Scott Blum <dragonsinth@gmail.com>
2023-08-31 12:14:34 -04:00
dependabot[bot]
dd2f60135c Bump github.com/jhump/protoreflect from 1.13.0 to 1.14.0 (#343)
* Bump github.com/jhump/protoreflect from 1.13.0 to 1.14.0

Bumps [github.com/jhump/protoreflect](https://github.com/jhump/protoreflect) from 1.13.0 to 1.14.0.
- [Release notes](https://github.com/jhump/protoreflect/releases)
- [Commits](https://github.com/jhump/protoreflect/compare/v1.13.0...v1.14.0)

---
updated-dependencies:
- dependency-name: github.com/jhump/protoreflect
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix ci

* what can we even build on?

* stop testing old things

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Scott Blum <dragonsinth@gmail.com>
2022-11-01 10:26:55 -04:00
Joshua Humphries
8d7770a962 use latest version of protoreflect (#212) 2021-02-22 17:32:40 -05:00
Joshua Humphries
ba5f667e13 fix latest CI breakages by forking code from grpc-go's interop/testing
Also moves testing package to internal/testing
2020-08-31 14:44:59 -04:00
Joshua Humphries
f0723c6273 fix flaky test (#93) 2019-03-25 10:34:32 -04:00
Joshua Humphries
fe97274a1b staticcheck no longer runs on Go 1.10 (#92)
* staticcheck no longer runs on Go 1.10, so run it on Go 1.11 in CI
* be explicit about default make target in .travis.yml
2019-03-22 14:35:01 -04:00
Joshua Humphries
ca5693f42c support unix sockets (#26) 2018-03-27 11:24:35 -04:00
Joshua Humphries
2a6ef4e19e attempt to fix flaky test (#8) 2018-02-19 18:22:19 -05:00
Josh Humphries
eda00e475b fix test that is flaky and is failing in CI more than is acceptable 2017-12-13 21:59:30 -05:00
Josh Humphries
91fb94b700 fix CI tests to work with go 1.6; add another error message that was observed in CI 2017-12-13 15:31:48 -05:00
Josh Humphries
6c05311fb9 use custom dialer so we can show better error messages when things like TLS handshakes go awry; restore error message checks in tls tests 2017-12-13 15:30:57 -05:00
Josh Humphries
45e17ae10b grpc connection management no longer yields same errors from dial; also fix fmt issue in error message 2017-12-05 01:53:17 -05:00
Josh Humphries
9dfaded6cf initial commit, functioning grpcurl command-line util 2017-11-20 13:15:15 -05:00