React Native Ssl Pinning

screenshot of React Native Ssl Pinning
react-native

React Native ssl pinning and cookies handling based on okhttp3 on (Android). and AFNetworking on (iOS)

Overview

The react-native-ssl-pinning package allows for SSL pinning and public key pinning in React Native using OkHttp 3 on Android and AFNetworking on iOS. It provides a solution for implementing these security measures in mobile applications built with React Native.

Features

  • SSL Pinning: Enhances security by validating SSL certificates against known trusted certificates.
  • Public Key Pinning: Ensures the authenticity of the server by matching the public key of the server with a pre-configured key.
  • Easy Installation: Simple steps for integrating the package into React Native projects.
  • Platform Support: Works seamlessly on both Android and iOS platforms.
  • Automated Linking: Automatic linking feature for React Native versions 0.60 and above.
  • Manual Setup: Step-by-step guide for manual installation on both iOS and Android platforms.
  • Certificate Handling: Instructions on creating and converting certificates for implementation.

React Native SSL Pinning Installation Guide

  1. Install the react-native-ssl-pinning package:
    $ npm install react-native-ssl-pinning --save
    
  2. For automatic installation on React Native 0.60+, the linking should occur automatically. For iOS, run:
    $ pod install
    

Manual Installation

iOS

  1. In XCode, navigate to the project navigator and right-click on Libraries ➜ Add Files to [your project's name].
  2. Add RNSslPinning.xcodeproj from node_modules/react-native-ssl-pinning.
  3. In XCode project navigator, select your project. Add libRNSslPinning.a to Build Phases ➜ Link Binary With Libraries.
  4. Run your project (Cmd+R).

Android

  1. Add maven { url "https://jitpack.io" } to the project level build.gradle.
  2. Modify MainActivity.java to include import com.toyberman.RNSslPinningPackage;.
  3. Add new RNSslPinningPackage() to the list returned by the getPackages() method.
  4. Update android/settings.gradle and android/app/build.gradle.

Summary

The react-native-ssl-pinning package is a reliable solution for implementing SSL pinning and public key pinning in React Native applications. It offers easy installation, platform support for Android and iOS, and detailed instructions for manual setup. By following the provided steps, developers can enhance the security of their mobile apps and ensure secure communication with servers.

react-native
React Native

React Native is a framework for building mobile applications using React and JavaScript. It enables developers to write once and deploy to multiple platforms, including iOS, Android, and the web, while providing a native app-like experience to users.