Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network calls via FastImage are not being SSL Pinned #313

Open
amanmoar277 opened this issue May 3, 2024 · 2 comments
Open

Network calls via FastImage are not being SSL Pinned #313

amanmoar277 opened this issue May 3, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@amanmoar277
Copy link

amanmoar277 commented May 3, 2024

In my react-native app, I want to do SSL pinning only for IOS. So, I have pinned a domain (assume aaa.bbb.com, this domain serves me the images).

I am making calls to this domain to fetch the images by two ways

  1. Directly using axios
  2. Using FastImage - https://www.npmjs.com/package/react-native-fast-image

When I run my application by putting some wrong hash.
if (Platform.OS === 'ios')
await initializeSslPinning({
'aaa.bbb.com': {
includeSubdomains: true,
publicKeyHashes: [
'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=',
'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB=',
],
}
})

I can see that the calls made via axios are being pinned successfully and there is no response. But the calls made via FastImage gave back 200 StatusCode.

Is this something expected from this library because FastImage uses SDWebImage and SDWebImage is not supported by this library.

If it is supported - Is there anything wrong that I am doing in the above code?
If fastImage is still not supported - Is there any plan to support this library in future?

@frw
Copy link
Owner

frw commented May 8, 2024

Hey @amanmoar277

Unfortunately, react-native-fast-image fetches images via it's own implementation of network requests, separate from the React Native networking API. This means that the network requests by fast-image would not be affected by this library, per this note.

No plans to support it at the moment (also because it seems like fast-image is no longer being actively maintained), but it seems like it's doable to add pinning to the underlying libraries if anyone wants to take a crack at it:
https://bumptech.github.io/glide/doc/configuration.html#libraries
https://github.com/SDWebImage/SDWebImage/wiki/Advanced-Usage#custom-download-operation-40

@frw frw added the enhancement New feature or request label May 8, 2024
@amanmoar277
Copy link
Author

Hi @frw, does it make any difference if we use TrustKit at native side directly instead of using this lib?
Could you please help me understanding this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants