-
Notifications
You must be signed in to change notification settings - Fork 695
Closed
Description
Description
All API commands fail with discoveryError when using the pre-built binary (npm or shell installer) on macOS. The root cause is a TLS compatibility issue between rustls and Google's Discovery API servers.
$ gws drive files list --params '{"pageSize": 5}'
{
"error": {
"code": 500,
"message": "Failed to fetch Discovery Document for drive/v3: HTTP 404 Not Found (tried both standard and $discovery URLs)",
"reason": "discoveryError"
}
}
Every service is affected — Drive (404), Gmail (403), Calendar, Sheets, etc.
Root Cause
Cargo.toml configures reqwest with rustls-tls and default-features = false:
reqwest = { version = "0.12", features = ["json", "stream", "rustls-tls"], default-features = false }The same Discovery URL works fine with curl (which uses SecureTransport/LibreSSL on macOS):
$ curl -s -o /dev/null -w "%{http_code}" "https://www.googleapis.com/discovery/v1/apis/drive/v3/rest"
200
Fix
Switching to native-tls resolves the issue immediately:
reqwest = { version = "0.12", features = ["json", "stream", "native-tls"] }After rebuilding from source with this change, all APIs work correctly:
$ cargo build --release # with native-tls
$ ./target/release/gws drive files list --params '{"pageSize": 3}'
{
"files": [ ... ], # works!
"kind": "drive#fileList"
}
Environment
- OS: macOS 15 (Darwin 25.3.0), Apple Silicon (aarch64)
- gws version: 0.6.3 (both npm and shell installer binaries)
- Install methods tested:
npm install -g @googleworkspace/cli, shell installer script - Node: v24.13.0
Suggested Fix
Consider one of:
- Switch to
native-tls(uses platform TLS — SecureTransport on macOS, SChannel on Windows, OpenSSL on Linux) - Use feature flags to allow both backends:
rustls-tls+native-tls-vendoredas fallback - Investigate the specific rustls/Google API server incompatibility (possibly related to TLS session handling or certificate chain verification)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels