- Get certificate from host
openssl s_client -servername www.google.com -connect www.google.com:443 -prexit -showcerts
-
Copy text from BEGIN to END of last section and save to googlecert.pem file
-
RUN
python get_pin_from_certificate.py googlecert.pem
to get pin key -
Added OkHttpCertPin.java and modify MainActivity.java
-
Added pin key into OKHttpCertPin.java
-
gem install cocoapods
-
cd ios && pod init
-
add
pod 'TrustKit'
into podfile -
pod install
-
open xcode on project
- Open 'Build Settings', search 'Header Search Path'.
- Add $(SRCROOT)/../node_modules/react-native/React and set it recursive
-
on AppDelegate.m add trustKitConfig
-
run on simmulator
referrence
- facebook/react-native#12077 (comment)
- https://www.madebymany.com/stories/a-year-of-react-native-ssl-pinning
- https://stackoverflow.com/questions/40240321/how-can-i-implement-ssl-certificate-pinning-while-using-react-native/40334166#40334166
- https://stackoverflow.com/questions/40240321/how-can-i-implement-ssl-certificate-pinning-while-using-react-native
- https://github.com/Kudo/react-native-ssl-pinning-proposal
- https://github.com/datatheorem/TrustKit/blob/master/docs/getting-started.md