SslConfigService class
Service for configuring global SSL/TLS certificate handling
This service provides centralized SSL certificate configuration for ALL network connections in the application, including:
- HTTP/HTTPS requests (via HttpClient)
- WebSocket connections (wss://)
- GraphQL clients (both HTTP and WebSocket)
- Polkadart WebSocket providers (WsProvider)
IMPORTANT: This must be called BEFORE any network connections are made, typically at the very start of app initialization.
Use Cases
Older Android Devices (API < 24)
Older Android versions have outdated certificate stores that don't recognize newer Certificate Authorities. This service allows the app to work on these devices.
Development & Testing
When working with:
- Self-signed certificates
- Internal/test servers with certificate issues
- GitLab instances with certificate problems
Security Note
Bypassing SSL certificate verification removes an important security layer. However, for blockchain/decentralized apps where data integrity is verified through cryptographic signatures at the application level, this is an acceptable trade-off to ensure broader device compatibility.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- isConfigured → bool
-
Check if SSL configuration has been set
no setter
Static Methods
-
configureSslCertificateHandling(
{bool allowBadCertificates = true}) → void - Configure global SSL certificate handling to allow bad certificates
-
resetSslConfiguration(
) → void - Reset SSL configuration to default (strict validation)