connect_secure 0.0.3 copy "connect_secure: ^0.0.3" to clipboard
connect_secure: ^0.0.3 copied to clipboard

A Flutter package for SSL Pinning and secure network connections using http and dio.

connect_secure πŸ”’ #

A Dart/Flutter package to add SSL Pinning support in your applications. It ensures that your app only communicates with trusted servers by validating server certificates or public key fingerprints.

This helps protect against MITM (Man-in-the-Middle) attacks and ensures secure communication.


✨ Features #

  • βœ… SSL Pinning with SHA-256 certificate fingerprints
  • βœ… Works with Dio HTTP Client
  • βœ… Easy to configure and integrate
  • βœ… Lightweight & customizable

πŸš€ Installation #

Add the dependency in your pubspec.yaml:

dependencies:
  connect_secure: ^1.0.0

Then run:

flutter pub get

πŸ“– Usage #

Import the package:

import 'package:connect_secure/connect_secure.dart';

Example: Using SSL Pinning with Dio #

import 'package:dio/dio.dart';
import 'package:connect_secure/connect_secure.dart';

void main() async {
  final dio = Dio();

  // Attach SSL Pinning adapter
  dio.httpClientAdapter = DioSslPinning(
    allowedFingerprints: [
      // Add your server's SHA-256 certificate fingerprints
      "12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF:12:34:56:78:90:AB:CD:EF",
    ],
  );

  try {
    final response = await dio.get("https://your-secure-api.com");
    print("βœ… Response: ${response.data}");
  } catch (e) {
    print("❌ SSL Pinning validation failed: $e");
  }
}

πŸ“‚ Example Project #

See the example for a full working demo.


πŸ›  Roadmap #

  • ❌ Support multiple SSL pinning modes (certificate, public key)
  • ❌ Add support for other HTTP clients (http package)
  • ❌ Add automatic fingerprint generation tool

🀝 Contributing #

Contributions are welcome!

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin feature/my-feature)
  5. Create a Pull Request

πŸ“œ License #

This project is licensed under the MIT License. See the LICENSE file for details.


πŸ‘¨β€πŸ’» Author #

Neethu KT


πŸ‘‰ This will also help increase your pub.flutter-io.cn score, since your README will clearly explain the package.

Do you want me to also draft a CHANGELOG.md (with v1.0.0 - Initial release with SSL Pinning support), so your package looks more polished?

7
likes
0
points
198
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for SSL Pinning and secure network connections using http and dio.

Repository (GitLab)
View/report issues

License

unknown (license)

Dependencies

crypto, dio, http

More

Packages that depend on connect_secure