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

Chain validation failed #43807

Closed
valery-lavrik opened this issue Apr 3, 2024 · 3 comments
Closed

Chain validation failed #43807

valery-lavrik opened this issue Apr 3, 2024 · 3 comments
Labels
Resolution: Answered When the issue is resolved with a simple answer

Comments

@valery-lavrik
Copy link

Description

Good afternoon! I'm trying to connect the image like this:

<Image
    source={{ 
        uri: "https://com-x.life/uploads/posts/2024-03/the-sandman-universe-special-thessaly-001-0000.jpg", 
        headers: {
            Referer: 'https://com-x.life/',
        },
    }}
    onError={(e) => {
        console.log('ERROR', e?.nativeEvent?.error)
    }}
/>

But on some devices (for example, android tv box) I get the error: "Chain validation failed"
It is clear that there is some kind of problem with the certificate on the server.
But the server is not mine and I can't fix it.

How can I disable certificate verification in react-native and ignore such errors?

Steps to reproduce

Any version of react-native

React Native Version

0.73.6

Affected Platforms

Runtime - Android

Output of npx react-native info

npx react-native info
warn Package react-native-sqlite-storage contains invalid configuration: "dependency.platforms.ios.project" is not allowed. Please verify it's properly linked using "npx react-native config" command and contact the package maintainers about this.
info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.22000
  CPU: (4) x64 Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz
  Memory: 5.46 GB / 15.92 GB
Binaries:
  Node:
    version: 20.11.1
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.21
    path: C:\Program Files\nodejs\yarn.CMD
  npm:
    version: 10.2.4
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-222.4459.24.2221.10121639
  Visual Studio: Not Found
Languages:
  Java:
    version: 17.0.10
    path: /c/Program Files/Microsoft/jdk-17.0.10.7-hotspot/bin/javac
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 13.6.4
    wanted: ^13.6.2
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.6
    wanted: ^0.73.6
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

Chain validation failed

Reproducer

https://github.com/react-native-community/reproducer-react-native

Screenshots and Videos

image

@github-actions github-actions bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Apr 3, 2024
Copy link

github-actions bot commented Apr 3, 2024

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

@cortinico
Copy link
Contributor

You can override the default OkHTTP Client on Android with your own client by invoking:

OkHttpClientProvider.setOkHttpClientFactory

and specifying your own OkHttpClientFactory

@cortinico cortinico added Resolution: Answered When the issue is resolved with a simple answer and removed Needs: Triage 🔍 Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels Apr 3, 2024
@valery-lavrik
Copy link
Author

@cortinico Thanks for the answer!
But unfortunately, I do not know java as well as I need to solve this problem. Could you give me an example of the code and where to put it?
I would be very grateful to you!

I found similar solutions on the Internet, but they all turned out to be non-working...

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Answered When the issue is resolved with a simple answer
Projects
None yet
Development

No branches or pull requests

2 participants