Skip to main content

Configuration

Configuration

These config values are available:

PropTypeDescriptionSince
certsstring[]Paths to your SSL Certificates relative to the root of your project. Your Primary Cert. should be the first entry1.0.0
excludedDomainsstring[]Domains to exclude from SSL Pinning when making requests. Domains should be be fully qualified domains that include the protocol.1.1.0

Examples

In capacitor.config.json:

{
"plugins": {
"CapacitorHttp": {
"enabled": true,
},
"SSLPinning": {
"certs": ["sslCerts/productionCerts/primary.cer", "sslCerts/productionCerts/backup.cer"],
"excludedDomains": ["https://analytics.google.com, https://myapi.com/subpath"]
}
}
}

In capacitor.config.ts:

/// <reference types="@capacitor/sslpinning" />

import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
plugins: {
CapacitorHttp: {
enabled: true,
},
SSLPinning: {
certs: ["sslCerts/productionCerts/primary.cer", "sslCerts/productionCerts/backup.cer"],
excludedDomains: ["https://analytics.google.com, https://myapi.com/subpath"],
},
},
};

export default config;