wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.6k stars 555 forks source link

I have check Multiple time of different solution but.. #871

Open krsaurabhmca opened 1 month ago

krsaurabhmca commented 1 month ago

[Error: ReactNativeBlobUtil request error: java.lang.IllegalStateException: Use of own trust manager but none definedjava.lang.IllegalStateException: Use of own trust manager but none defined] LOG [Error: ReactNativeBlobUtil request error: java.lang.IllegalStateException: Use of own trust manager but none definedjava.lang.IllegalStateException: Use of own trust manager but none defined]

rajivchaulagain commented 3 weeks ago

for android use this

<Pdf
  trustAllCerts={Platform.OS === 'ios'} // Only apply this for iOS
  style={styles.viewer}
  source={{
    uri: currentUrl,
    headers: { Cookie: authCookie },
  }}
  onLoadProgress={(progress) => {
    console.log('Loading progress:', progress);
  }}
  onLoadComplete={(pageCount) => {
    console.log('PDF loaded, total pages:', pageCount);
  }}
/>
GabrielBermudez commented 4 days ago

Good morning. I have a question regarding security: how reliable is it to set trustAllCerts to false in Android? I need to implement this library in an enterprise app, and if this prop introduces vulnerabilities, I should consider switching to another solution. In threads related to this topic, everyone suggests this as a solution, but no one explains if it could cause security issues.

rajivchaulagain commented 4 days ago

@GabrielBermudez this must be helpful for u https://github.com/RonRadtke/react-native-blob-util#self-signed-ssl-server