ensure all traffic is https. fix bug in sensor code