Repository navigation
Description
Describe the bug
The gRPC connection pool accepts the TLS mode insecure without any further condition. pool.StringToTLSMode("insecure") returns TLSInsecure, and NewConn then uses TLS with InsecureSkipVerify: true, so the server certificate is never verified:
reva/pkg/rgrpc/todo/pool/pool.go
Lines 39 to 50 in ebae57c
func StringToTLSMode(m string) (TLSMode, error) { switch m { case "off", "": return TLSOff, nil case "insecure": return TLSInsecure, nil case "on": return TLSOn, nil default: return TLSOff, fmt.Errorf("unknown TLS mode: '%s'. Valid values are 'on', 'off' and 'insecure'", m) } } reva/pkg/rgrpc/todo/pool/connection.go
Lines 57 to 61 in ebae57c
case TLSInsecure: tlsConfig := tls.Config{ InsecureSkipVerify: true, //nolint:gosec } cred = credentials.NewTLS(&tlsConfig)
In OpenCloud, the mode comes from OC_GRPC_CLIENT_TLS_MODE. opencloud-eu/opencloud#4117 makes the go-micro gRPC clients refuse insecure unless OC_INSECURE is true, and the description of OC_GRPC_CLIENT_TLS_MODE now says so. The connections created through this pool read the same setting, but don't have that check.
Steps to reproduce
- Run OpenCloud with
OC_GRPC_TLS_ENABLED=true(auto-generated certificate) andOC_GRPC_CLIENT_TLS_MODE=insecure, withoutOC_INSECURE. - Start a service that only uses the connection pool and no go-micro client, e.g.
clientlogorcollaboration, as a separate process.
Expected behavior
The service refuses to start, like the services with a go-micro client: insecure is only accepted when OC_INSECURE is true.
Actual behavior
The service starts and connects to the other services without verifying their certificates.
Impact
- Only installations that set
OC_GRPC_CLIENT_TLS_MODE=insecureexplicitly are affected. The defaultoffis not. - In a single-process
opencloud server, the services with a go-micro client already fail to start with fix(grpc)!: require OC_INSECURE=true for the insecure client TLS mode opencloud#4117, so the server doesn't come up. The gap matters when services run as separate processes or containers. - The setting then behaves differently from what its description says, without an error or a log message.
Possible fix
Apply the same condition in the pool, e.g. in StringToTLSMode or in NewConn, and bump reva in opencloud. The services in opencloud that call pool.StringToTLSMode would then fail with a clear error, as the go-micro clients do.
Setup
Code on main (ebae57c). Not reproduced on a running instance; the behaviour follows from the code above.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsPrio <= 3
Activity
asaah262 commentedon Nov 25, 2026
The mode also reaches reva through the storage-users config (permissionssvc_tls_mode) and through grpc_client_options in the reva configs, so a fix needs to cover those as well. An alternative to guarding each client: check OC_GRPC_CLIENT_TLS_MODE once at startup, for all services.