Your security policy update exposed an incomplete certificate configuration. Here’s the systematic fix for all three focus areas:
X.509 Certificate Validation Requirements:
The updated security policy now enforces RFC 5280 certificate chain validation, which is stricter than the previous validation. Every certificate in the chain must meet these requirements:
- Valid signature from the issuing CA
- Not expired and within validity period
- Correct key usage extensions
- No revoked certificates (if CRL/OCSP is configured)
- Subject matches expected pattern
Your error indicates the chain validation is failing. Verify your device certificates with:
openssl verify -CAfile ca-chain.pem device-cert.pem
If this fails locally, it will fail in IoT Core. The most common issue is that device certificates were signed by an intermediate CA, but only the root CA was uploaded to IoT Core.
Trusted CA Configuration:
You need to upload the complete CA certificate chain to your IoT Core registry. Here’s the correct procedure:
- Export your complete CA chain:
# Concatenate root and intermediate CAs
cat intermediate-ca.pem root-ca.pem > ca-chain.pem
- Add the complete chain to IoT Core:
gcloud iot registries credentials create \
--registry=REGISTRY_NAME \
--region=REGION \
--path=ca-chain.pem
- Verify the upload:
gcloud iot registries describe REGISTRY_NAME --region=REGION
Look for multiple credentials entries - you should see both root and intermediate CAs listed with their fingerprints.
Policy Update Process:
Your security policy update should have included these steps:
- Test in a non-production registry first
- Upload all required CA certificates before enabling strict validation
- Verify existing devices can still connect
- Then enable the new policy
To fix your current situation without rolling back:
- Create a temporary security policy that allows both old and new validation rules
- Upload the missing intermediate CA certificates
- Test device registration with the complete chain
- Once confirmed working, remove the temporary policy
For the certificate chain validation error specifically, check these common issues:
- Intermediate CA missing: Add all intermediate CAs to the registry
- Wrong certificate order: Chain must be device → intermediate → root
- Key usage mismatch: Intermediate CA must have keyCertSign enabled
- Extended key usage: CA certificates need serverAuth or clientAuth
- Basic constraints: CA certificates must have CA:TRUE
Verify your intermediate CA has correct extensions:
openssl x509 -in intermediate-ca.pem -text -noout | grep -A 5 "X509v3"
You should see:
X509v3 Basic Constraints: critical
CA:TRUE
X509v3 Key Usage: critical
Certificate Sign, CRL Sign
If your intermediate CA is missing these extensions, you’ll need to reissue it with correct attributes. This is a PKI infrastructure issue, not just an IoT Core configuration problem.
One critical point: the security policy validation happens at registration time AND at connection time. Even if you fix registration, existing devices might fail to connect if their certificates don’t meet the new validation rules. Plan a certificate rotation for all devices to ensure compliance.
Monitor certificate validation failures with this Cloud Logging query:
resource.type="cloudiot_device"
jsonPayload.eventType="CERTIFICATE_VALIDATION_ERROR"
This will show you exactly which devices and which validation rules are failing.