When running livetkit sdk on react native I am get...
# ask-ai
p
When running livetkit sdk on react native I am getting error - ava.security.cert.CertPathValidatorException: Trust anchor for certification path not found.
t
Thanks for reaching out, mithun. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm sorry to hear you're encountering the error "java.security.cert.CertPathValidatorException: Trust anchor for certification path not found." This usually happens because of some challenges with SSL/TLS certificate validation. To better assist you, could you please share a bit more about your setup? For example: • Are you using a self-signed certificate or one from a trusted Certificate Authority (CA)? • Have you set up the certificate within your React Native app? • Is your server custom, or are you using LiveKit Cloud? Knowing these details will really help us work together to find a solution. Looking forward to your reply!
p
• I am using self-signed certificate.. Have you set up the certificate within your React Native app? yes • Is your server custom, or are you using LiveKit Cloud? self hosted
t
I understand how frustrating it can be to run into SSL issues with your React Native app, so let’s work through this together! LiveKit doesn’t support self-signed certificates for secure connections in production, which is why you’re seeing that error. The good news is, you can fix this by using a valid SSL certificate from a trusted Certificate Authority (CA). Here’s a friendly step-by-step guide to help you out: 1. Use a trusted SSL certificate: You can get one for free from providers like Let's Encrypt or ZeroSSL. 2. If you’re using Docker Compose or a VM: LiveKit makes this easy by automatically provisioning valid TLS certificates with Caddy, using Let's Encrypt or ZeroSSL. So, no need to manage certificates manually here! 3. For Kubernetes deployments: You’ll want to import trusted certificates as Kubernetes Secrets using
kubectl create secret tls
. I’m happy to help if you need guidance on this step. 4. Make sure your domain’s DNS is properly pointing to your server, since certificate issuance requires your server to be publicly accessible. The easiest way forward is to deploy LiveKit using the official scripts that set up Caddy for automatic certificate management. This will help your React Native app connect securely without those pesky SSL/TLS errors. Sources: Deploying LiveKit | LiveKit Docs | Operational Guidance | livekit/livekit_composite | DeepWiki | Deploy to a VM | LiveKit Docs | Deploy to Kubernetes | LiveKit Docs
p
but i am hosting livekit myself.. the certiciate I am using is from our internal root ca
t
Thank you for reaching out! I wanted to share that the LiveKit React Native SDK doesn’t currently support trusting internal or self-signed root CA certificates directly. This applies across all our client-facing SDKs, including React Native. But don’t worry—here are some options that can help you move forward: 1. Use a Publicly Trusted Certificate: One of the easiest and most reliable ways is to replace your internal CA-signed certificate with one from a publicly trusted Certificate Authority (CA), like Let’s Encrypt. 2. Configure the Internal CA at the Operating System Level: On iOS and Android devices, you can manually trust a root CA certificate through the device settings. Just keep in mind this needs to be done on each device and might not be ideal for production environments. 3. Modify Native Code (Advanced): If you’re comfortable with some deeper customization, you can modify the native networking layer to fully control TLS trust: • iOS: Adjust the native WebRTC or URLSession settings to include your internal CA in the trust store. • Android: Customize the
TrustManager
or update the
NetworkSecurityConfig.xml
to allow your internal CA. If you’d like, I’m here to guide you through setting up native-level TLS trust configuration on either iOS or Android. Just let me know how I can help! Sources: xtls/tls.go | pkg/sip/tls.go | End-to-end encryption | LiveKit Docs | Deploying LiveKit | LiveKit Docs | ios/LivekitReactNative.xcodeproj/project.pbxproj