0

I'm trying to run this demo on AWS Ubuntu, to check if the bug I reported in firefox is caused by running locally under HTTP; all's working on Chrome, so it may not be. Possibly.

I set the demo up on AWS Ubuntu, and generated a self-signed cert using:

openssl genrsa 2048 > host.key
chmod 400 host.key
openssl req -new -x509 -nodes -sha256 -days 365 -key host.key -out host.cert

And yet, Firefox is reporting that Navigator.mediaDevices is undefined, whilst Chrome is reporting that it Cannot read property 'getUserMedia' of undefined

I assume this means I need a genuine trusted 'local.crt' and 'local.key' file, rather than self-signed? I didn't realise it'd be so strict.

Can anybody instruct me on how to do that without buying one, as I only want to test?

Thanks :)

harry young
  • 600
  • 1
  • 8
  • 24
  • 1
    https://letsencrypt.org/ – Rob Mar 12 '21 at 19:50
  • a google search led me there, too. Will [this](https://certbot.eff.org/lets-encrypt/ubuntufocal-webproduct) provide the 'local.crt' and 'local.key' file? It's not clear. – harry young Mar 12 '21 at 19:59
  • 1
    Yep, that's what i use. Although i use letsencrypt and certbot in docker containers. Not necessary though. – Rob Mar 12 '21 at 20:14

1 Answers1

1

You are correct that this is a pain in the xxx neck when doing casual demos and bug-reproductions.

I do one of two things when I need to do this.

  1. put the app on https://glitch.com . They give you a durable https://yourprojectname.glitch.me URL to work with. Good for one-offs. I have had bug reports against both Chromium and Firefox accepted with glitch.com examples.

  2. deploy the app to Heroku. They give you a durable https://example-whatever-12345.herokuapp.com URL to use. Good for bigger stuff.

Others use https://netlify.com for purely static stuff. I haven't used it myself.

If you have your own domain and server you can also use https://letsencrypt.org/ to obtain certs. But it takes a mess of server rigging, and might not be best for casual stuff.

O. Jones
  • 103,626
  • 17
  • 118
  • 172
  • I was over-tired. I made a mistake... stupidly I generated an SSL cert for the codebase on my local machine, thinking it was the copy on AWS... So it actually does seem to work with self-signed certificates! Sorry! Thanks for your help. Now I have [this issue](https://stackoverflow.com/questions/66607588/do-i-have-the-wrong-ports-open?noredirect=1#comment117746568_66607588). – harry young Mar 13 '21 at 16:18
  • nope. Pretty sure I was correct the first time - Navigator.mediaDevices is undefined, even with self-signed certs. Frustrating. Glitch storage limit is too small, so I tried Heroku and [had this error](https://stackoverflow.com/questions/66617862/why-am-i-being-greeted-with-an-error-on-my-heroku-app), so I went back to my AWS instance and came to the conclusion that it was the certs causing the issue as I suspected when authoring this post! So I tried certbot - which demanded a domain, rather than an IP. Sooo, I'm trying Heroku again. – harry young Mar 14 '21 at 21:24