Skip to content

Instantly share code, notes, and snippets.

@agronick
Created December 3, 2018 23:49
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agronick/30efc1a64a917915b7fdea1dffb892ce to your computer and use it in GitHub Desktop.
Save agronick/30efc1a64a917915b7fdea1dffb892ce to your computer and use it in GitHub Desktop.
VLC Linux with Chromecast: Solution to error "gnutls tls client error: Certificate verification failure: The certificate is NOT trusted. The certificate issuer is unknown. The name in the certificate does not match the expected. "
#!/bin/bash
# On my machine VLC fails to connect to chromecast. If I specify the IP it fails to connect because of certificate errors. I can
# manually download the certificate but it is only valid for 2 days. This little script gets it all working.
# Set your ip address below and call this script with the filename.
CHROMECAST_IP=192.168.1.153
gnutls-cli --save-cert=chromecast.pem --insecure $CHROMECAST_IP:8009
mkdir -p ~/.local/share/vlc/certs
mv chromecast.pem ~/.local/share/vlc/certs
vlc "$1" --sout "#chromecast" --gnutls-dir-trust=/home/$USER --sout-chromecast-ip=$CHROMECAST_IP --demux-filter=demux_chromecast
@avinashGonsalves
Copy link

This didnt work for me, it still said

[00007fa9200172f0] gnutls tls client error: Certificate verification failure: The certificate is NOT trusted. The certificate issuer is unknown. The name in the certificate does not match the expected. 
[00007fa9200172f0] main tls client error: TLS session handshake error

@Headcase0
Copy link

This didn't work for me; however, creating a firewall exception for VLC on port 8009 did work. Might be worth giving it a shot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment