Domain Not Registered
Thrown when the domain is not registered for pinning and enforcement is enabled.
This error occurs only in TrustPinMode.STRICT mode when attempting to verify a certificate for a domain that is not configured in your TrustPin pinning configuration. This enforces the security policy that all connections must be explicitly validated.
When This Occurs
Strict mode only: This error is not thrown in TrustPinMode.PERMISSIVE mode
Unregistered domains: Domain not found in TrustPin dashboard configuration
Typos in domain: Incorrect domain name or subdomain
New services: Recently added services not yet registered
Resolution Steps
Register domain: Add domain to TrustPin dashboard with appropriate pins
Verify domain name: Check for typos or incorrect subdomain
Update configuration: Refresh TrustPin configuration if recently added
Consider mode: Evaluate if TrustPinMode.PERMISSIVE is appropriate
Domain Registration
To register a domain in TrustPin:
TrustPin Dashboard: Log into your TrustPin account
Add Domain: Configure domain with certificate pins
Generate Pins: Create SHA-256 or SHA-512 hashes of certificates
Set Expiration: Configure appropriate expiration dates
Test Configuration: Verify in staging environment
Example Handling
try {
trustPin.verify("new-api.example.com", certificate)
} catch (e: TrustPinError.DomainNotRegistered) {
// Domain not configured for pinning
logger.warning("Unregistered domain accessed: $domain")
// Options:
// 1. Register domain in TrustPin dashboard
// 2. Switch to permissive mode temporarily
// 3. Update application to handle unregistered domains
}Security Considerations
Intentional restriction: This error enforces your security policy
Audit trail: Log these events for security monitoring
Process improvement: May indicate need for better domain management
Compliance: Helps maintain strict security compliance
Migration Strategy
When implementing strict mode:
// Phase 1: Discovery with permissive mode
trustPin.setLogLevel(TrustPinLogLevel.INFO)
trustPin.setup(mode = TrustPinMode.PERMISSIVE)
// Phase 2: Register discovered domains
// (Use logs to identify all accessed domains)
// Phase 3: Enable strict mode
trustPin.setup(mode = TrustPinMode.STRICT)