# @bam.tech/react-native-ssl-pinning

> SSLPinning config for expo

Latest version **1.0.0** (published 2023-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @bam.tech/react-native-ssl-pinning
pnpm add @bam.tech/react-native-ssl-pinning
yarn add @bam.tech/react-native-ssl-pinning
bun add @bam.tech/react-native-ssl-pinning
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-10-17 |
| First published | 2023-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 264.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Hugo Khlaut |
| Maintainers | matthieugbam, hugok, pierrezimmermann, pierpo, alexisd, p0labrd, antoine-cottineau, laurence923, cyrilbo, clementtab, antoined, marekkalnik, almouro, tychota, julienc6, minishlink |
| Keywords | react-native, expo, react-native-ssl-pinning, SSLPinning |

## Links

- npm: https://www.npmjs.com/package/@bam.tech/react-native-ssl-pinning
- Repository: https://github.com/bamlab/config-plugin-ssl-pinning
- Homepage: https://github.com/bamlab/config-plugin-ssl-pinning#readme
- Issues: https://github.com/bamlab/config-plugin-ssl-pinning/issues
- npm.io page: https://npm.io/package/@bam.tech/react-native-ssl-pinning

## Dependencies (1)

- [@expo/config-plugins](https://npm.io/package/@expo/config-plugins.md) ^7.2.5

## Recent versions

- 1.0.0 (latest) — 2023-10-17
- 0.1.4 — 2023-09-14
- 0.1.3 — 2023-09-14
- 0.1.2 — 2023-09-14
- 0.1.1 — 2023-09-14
- 0.1.0 — 2023-09-14

## README

# react-native-ssl-pinning

## Overview

This module implements SSL Pinning using an expo-module and an expo-plugin

## Setting up the plugin

1. Add the plugin to your dev dependencies

   ```bash
   yarn add -D @bam.tech/react-native-ssl-pinning
   ```

1. In your `app.config.ts` file, add the following attributes.

   ```ts
   //Example of host name and certificates with google.com
   const hostName = "google.com";

   //Do not include the 'sha256/' part in certificates
   const certificateSHAFinal = "We74o5ME3USRtL6+B2UhXnwY9FR91QPJMYDtUNk6tEc=";
   const certificateSHAIntermediate = "zCTnfLwLKbS9S2sbp+uFz4KZOocFvXxkV06Ce9O5M2w=";
   const certificateSHARoot = "hxqRlPTu1bMS/0DITB1SSu0vd4u/8l8TjPgfaAp63Gc=";

   const config: ExpoConfig = {
     plugins: [
       [
         "@bam.tech/react-native-ssl-pinning",
         {
           hostName: hostName,
           certificates: [
             certificateSHAFinal,
             certificateSHAIntermediate,
             certificateSHARoot,
           ],
         },
       ],
     ],
   };

   module.exports = config;
   ```

## Using the plugin

1. To use the plugin, run the following commands:

```bash
  npx expo prebuild --clean
```

1. It generates the configuration file for our plugin, then run

```bash
  npx pod-install
```

1. You might need to clean your caches. If required, run :

```bash
    rm -rf ~/Library/Developer/Xcode/DerivedData
```

## Testing the plugin

1. To test if SSL Pinning is working, you can:

- break (change) one or several certificates and see if the connexion with the server is still up when you rebuild the app
- set up a proxy such as Proxyman and check if the connexion fails

---
_Source: https://npm.io/package/@bam.tech/react-native-ssl-pinning · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
