Closed th0mas closed 4 years ago
Looking at https://elixirforum.com/t/plug-ssl-redirects-socket-connection-problem-301/25347 it seems like we need to remove the line:
force_ssl: [rewrite_on: [:x_forwarded_proto]]
from prod.exs
@nelsonic Is there any reason this line is here/what does it do?
This is just to ensure SSL/TLS is used. It might not be strictly necessary for our CI App, but it would be good to setup for our home security in production, i.e. always enforce TLS. otherwise it would be trivial for a MITM for someone with physical access to the building. 💭
Fixed by adding a config option to enable SSL on websocket connections:
config.exs
config :smart_home_firmware,
ssl: true
hub_client.ex
defp get_scheme() do
if Application.fetch_env!(:smart_home_firmware, :ssl) do
"wss"
else
"ws"
end
end
Nice one @th0mas 👍
When attempting to connect from our test suite to the hub server we get some sort of
https
error:Seems like were not properly upgrading to a https connection...