0

I installed motion by apt and run as the default configuration. I open http://raspberrypi:8080 and I can see the camera's output. I will use it over the internet and I'm worried about the security of that. I want to change all connections to https which is the least security that I can configure. How can I make all connection to https? I didn't find anything in the config file.

Thanks.

M. Rostami
  • 4,323
  • 1
  • 17
  • 36
Portrique
  • 1
  • 3

1 Answers1

4

It's simple. There is some TLS feature for the web interface and also for the stream port.


Generate your certificate files:

apt-get install openssl

openssl genrsa -out /etc/motion/motion.key 4096
openssl req -new -key /etc/motion/motion.key -out /etc/motion/motion.crt

Now, you have created key and certificate file for the motion config file.


Motion config:

Add these lines to the /etc/motion/motion.conf:

stream_tls on
webcontrol_tls on
webcontrol_key /etc/motion/motion.key
webcontrol_cert /etc/motion/motion.crt  

Restart the motion service by service motion restart and then open https://raspberrypi:8080 on a host.


Related links:

Motion configuration file manual
SSL Certificate Signing with CAcert for Raspberry Pi, Ubuntu & Debian
Self-Signed_Certificate

M. Rostami
  • 4,323
  • 1
  • 17
  • 36