# rpc error: code = Unavailable desc = connection closed: tls: failed to verify certificate: x509: certificate has expired or is not yet valid

- **ID:** `go/grpc-tls-certificate-expired`
- **Domain:** go
- **Category:** auth_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The TLS certificate used by the gRPC server has expired or is not yet valid.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.2 | active | — | — |

## Workarounds

1. **Renew the TLS certificate and reload the server.** (95% success)
   ```
   openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 365
   ```
2. **Use insecure connection temporarily for debugging.** (90% success)
   ```
   conn, err := grpc.Dial(address, grpc.WithInsecure())
   ```

## Dead Ends

- **Restart the gRPC server without changing certificates.** — Expired certificate remains invalid after restart. (100% fail)
- **Set system time back to make certificate valid.** — Breaks other services and is a security risk. (50% fail)
