Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions grpc-tls-client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore binaries.
grpc-tls-client
26 changes: 26 additions & 0 deletions grpc-tls-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# gRPC TLS client

An example gRPC client supporting various TLS connection modes and other dial
options.

## Build

```
go build
```

## Run

```
./grpc-tls-client <grpc_address> <tls_mode> [<http_username> <http_password> [<keepalive_time>]]
```

`tls_mode`:
- `"off"`: Use non-encrypted connection
- `"off-alt"`: Use non-encrypted connection (alternative)
- `"insecure"`: Use TLS without certificate checks
- `"ca"`: Use TLS with custom CA certificate file
- `"system"`: Use TLS with system certificates and TLS v1.2
- `"system-alt"`: Use TLS with system certificates (alternative)
`username`, `password`: Use HTTP Basic authentication
`keepalive_time`: Send keep-alive requests
57 changes: 57 additions & 0 deletions grpc-tls-client/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
module grpc-tls-client

go 1.18

require (
github.com/oasisprotocol/oasis-core/go v0.2202.3
google.golang.org/grpc v1.49.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/eapache/channels v1.1.0 // indirect
github.com/eapache/queue v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.5.4 // indirect
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-isatty v0.0.16 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/prometheus/client_golang v1.13.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.13.0 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/tendermint/tendermint v0.34.21 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.8.0 // indirect
go.uber.org/zap v1.23.0 // indirect
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa // indirect
golang.org/x/net v0.0.0-20220920183852-bf014ff85ad5 // indirect
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
golang.org/x/text v0.4.0 // indirect
google.golang.org/genproto v0.0.0-20220725144611-272f38e5d71b // indirect
google.golang.org/grpc/security/advancedtls v0.0.0-20221004221323-12db695f1648 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading