Advertisement
Guest User

Untitled

a guest
Sep 10th, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. # Connecting to your chromecast
  2.  
  3. Find your chromecast's IP or hostname, and make sure you can reach it from any of these ways:
  4. - `ping chromecast.home` (if this works, use `chromecast.home` as its hostname)
  5. - or just `nmap -p8008,8009 192.168.1.0/24` or whatever network you're on, and find the device with both ports opened
  6.  
  7. # Casting videos
  8.  
  9. A first test which should fail: grab a random video file and run
  10.  
  11. `cvlc --sout="#chromecast{ip=<your_chromecast_ip>}" <your_file.mkv>`
  12.  
  13. If it works on the first try, great. But you might get a "gnutls client error: [..] The certificate issuer is unknown".
  14.  
  15. # Trusting your chromecast's certificate
  16.  
  17. You need to grab its self-signed certificate and add it to your trusted certificate store:
  18.  
  19. `openssl s_client -showcerts -connect <your_chromecast_ip> </dev/null 2>&1 | openssl x509 | sudo tee /etc/ssl/certs/chromecast.crt`
  20.  
  21. Re-run the same `cvlc` command. It should work, but if you get a "gnutls client error: [..] The name in the certificate does not match the expected" then go on.
  22.  
  23. # Talking to your chromecast using the hostname
  24.  
  25. The Common Name (CN) in your chromecast's certificate is its unique id. One (sad) way to allow a TLS connection to it is the following dirty trick: map its GUID to its IP in your `/etc/hosts` file, as if it were a hostname...
  26.  
  27. `GUID=$(cat /etc/ssl/certs/chromecast.crt | openssl x509 -noout -subject | sed -e 's/ //g' -Ee 's/subject=cn=//I')`
  28.  
  29. `echo "<your_chromecast_ip> ${GUID}" | sudo tee -a /etc/hosts`
  30.  
  31. That's it, re-run the `cvlc` command one last time, and it should work.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement