I'm trying to use SpeechRecognition/ webkitSpeechRecognition in my website, and thus need to run a dev server in django using https.
I've taken the following steps:
- install and configure
runserver_plus
fromdjango-extensions
add the cert generated by this to my cas in ubuntu.
# run server python3 manage.py runserver_plus --cert-file certs/localhost --reloader-interval 2 0.0.0.0:8000
then
# to copy certificates: sudo mkdir /usr/share/ca-certificates/extra sudo cp certs/localhost.crt /usr/share/ca-certificates/extra/localhost.crt sudo chmod -R 755 /usr/share/ca-certificates/extra/ sudo chmod 644 /usr/share/ca-certificates/extra/localhost.crt sudo dpkg-reconfigure ca-certificates sudo update-ca-certificates
I then restart everything to ensure changes have been accouted for, but the website is still not trusted on
https://127.0.0.1:8000
andhttps://localhost:8000
What am I doing wrong?
Note:
awk -v cmd='openssl x509 -noout -subject' '
/BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt
# gives:
...
subject=CN = localhost
subject=CN = *.localhost/CN=localhost, O = Dummy Certificate
This is my chrome certificate invlaid screenshot:
Note II: I am also having the same issue in Firefox
Note III:
I have enabled Allow invalid certificates for resources loaded from localhost.
by copying the below into the browser and selecting enable:
chrome://flags/#allow-insecure-localhost
This was not a quick fix. I'll outline the steps here that I took to fix the issue. For reference, I am using:
My solution was heavily influenced by this article.
Add certificate to chrome:
open your browser at
https://local.company.dev:8000/
and have a well deserved coffeeIf I have missed anything please don't hesitate to comment and I'll update the answer