How to Communicate with a Server Using a Self-Signed Certificate (My Own CA) Without Errors in Flutter's HTTP Client
Flutter
2021-03-12 02:02 (5 years ago)

Write this somewhere
class DevHttpOverrides extends HttpOverrides {
@override
HttpClient createHttpClient(SecurityContext context) {
return super.createHttpClient(context)
..badCertificateCallback = (X509Certificate cert, String host, int port) => true;
}
}
HttpOverrides.global = new DevHttpOverrides();
https://stackoverflow.com/questions/59622087/flutter-https-with-self-signed-certificate
Please rate this article (No signup or login required)
Current rating: 5.0 (1)
Related posts
Fix: Python 3.13 SSL error 'Basic Constraints of CA cert not marked critical' (VERIFY_X509_STRICT)
After Upgrading to Django 5 and Updating Dependencies, SSL: CERTIFICATE_VERIFY_FAILED Error Occurs When Sending Emails
Dart (Flutter) Dio Library Sends All HTTP Headers in Lowercase
When Using Nuxt Axios Proxy Mode, Axios Config's httpsAgent Injection Cannot Handle Self-Signed Certificates on the Proxy Server
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.
We look forward to discussing your development needs.