Comments (9)
Modifying the server should be about as simple as this wrapping the HTTP
server's socket in an SSL socket
https://www.piware.de/2011/01/creating-an-https-server-in-python/. If
this works properly, then no other Python code will be required. Pretty
much a one liner in the http component. You may also want to update the log
output on line 175 too
https://github.com/balloob/home-assistant/blob/master/homeassistant/components/http.py#L175
.
I think you may even be able to get away without any modification of the
Javascript API.
Fingers crossed this is an easy one. It is definitely a necessary feature.
Thanks,
Ryan Kraus
On Sun, Jun 7, 2015 at 6:06 PM, stvnrlly [email protected] wrote:
I don't see an option to serve Home Assistant over HTTPS. My server
automatically redirects connections from HTTP to HTTPS, so this prevents me
from accessing the app.If this isn't too complicated, I'm happy to give it a try and submit a
pull request, but I'll need some guidance about where to look.—
Reply to this email directly or view it on GitHub
#171.
from core.
Well, it's entirely possible that I'm doing something incorrectly, but putting that one-liner in a few different locations always seems to get this error:
homeassistant.bootstrap: Error during setup of component http
Traceback (most recent call last):
File "/usr/local/homeassistant/share/homeassistant/homeassistant/bootstrap.py", line 78, in _setup_component
if component.setup(hass, config):
File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/http.py", line 131, in setup
development, no_password_set)
File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/http.py", line 154, in __init__
super().__init__(server_address, request_handler_class)
File "/usr/local/python3/lib/python3.4/socketserver.py", line 429, in __init__
self.server_bind()
File "/usr/local/python3/lib/python3.4/http/server.py", line 133, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/local/python3/lib/python3.4/socketserver.py", line 440, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
from core.
It is equally as possible that you are not doing anything incorrectly and
the solution will be a bit more complicated. I have found that is usually
the case.
My intuition tells me the best place to perform this would be like 154,
right after the super call in the init function of the server class.
Also, in my first message, where I said, "Modifying the server should"...
Let's all just agree to pretend that I said, "Modifying the server could".
Thanks,
Ryan Kraus
On Mon, Jun 8, 2015 at 12:25 AM, stvnrlly [email protected] wrote:
Well, it's entirely possible that I'm doing something incorrectly, but
putting that one-liner in a few different locations always seems to get
this error:homeassistant.bootstrap: Error during setup of component http
Traceback (most recent call last):
File "/usr/local/homeassistant/share/homeassistant/homeassistant/bootstrap.py", line 78, in _setup_component
if component.setup(hass, config):
File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/http.py", line 131, in setup
development, no_password_set)
File "/usr/local/homeassistant/share/homeassistant/homeassistant/components/http.py", line 154, in init
super().init(server_address, request_handler_class)
File "/usr/local/python3/lib/python3.4/socketserver.py", line 429, in init
self.server_bind()
File "/usr/local/python3/lib/python3.4/http/server.py", line 133, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/local/python3/lib/python3.4/socketserver.py", line 440, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use—
Reply to this email directly or view it on GitHub
#171 (comment)
.
from core.
Maybe not what you want, but wouldn't it be easier to offload SSL handling to a server like NGINX?
http://chase-seibert.github.io/blog/2011/12/21/nginx-ssl-reverse-proxy-tutorial.html:
If you have an existing HTTP application that you want to enable SSL for, nginx provides a convenient reverse proxy mode. In this mode, nginx is just responsible for providing SSL encryption; the actual HTTP content is still being served from your existing web server or load balancer.
from core.
Yeah, @balloob, that's probably what I'll do here. If there's anything you can do on your end to make it simpler, I'd encourage it, but if not feel free to close this issue.
from core.
Currently Home Assistant is using a home grown HTTP framework based on the built-in HTTP server. This was a good start because I have always wanted to keep dependencies low. But as functionality has grown over time it is inevitable that at one point we will have to migrate to a real framework (probably Flask). Till that day comes, I prefer not to make the current HTTP stack any more complex.
from core.
@balloob Is there open issue where we can track this topic? (Flask migration, HTTPS config)
from core.
HTTPS is now supported natively.
https://home-assistant.io/components/http/
I don't see anything on Pivotal Tracker about migrating to Flask. I don't think it is currently in work or planned.
from core.
Nice, thank you.
Jan Pobořil
2016-01-16 23:02 GMT+01:00 Ryan Kraus [email protected]:
HTTPS is now supported natively.
https://home-assistant.io/components/http/I don't see anything on Pivotal Tracker about migrating to Flask. I don't
think it is currently in work.—
Reply to this email directly or view it on GitHub
#171 (comment)
.
from core.
Related Issues (20)
- User is able to add same UniFi Protect NVR twice HOT 6
- start_charging stop_charging service no longer working HOT 2
- SwitchBot Bot (Switch) upgraded for Advanced feature (>4.9) stop responding in HA randomly HOT 1
- Hidden devices excluded from label targeting
- Hydrawise Integration cannot be installed HOT 1
- TP-Link Smart Home DataUpdateCoordinator.__init__() takes 3 positional arguments but 4 were given HOT 1
- HUE ZeroDivisionError HOT 1
- Another wifi Tuya presence sensor is missing the lux sensor entity, take 2
- Water Heater Leak Shutoff Valve Sensor Showing Closed instead of Open HOT 4
- Glances - not seeing GPU information HOT 7
- Error from stream worker: Error demuxing stream: [Errno 110] Operation timed out
- homeassistant.helpers.event - Error while processing template
- iZone logs warning on startup about 'Entity does not set X but implements Y method' HOT 1
- Logger: plexapi
- Timeout sending notification to https://mobile-apps.home-assistant.io/api/sendPush/android/v1
- measurement 'None' which is not a valid unit for the device class ('temperature') it is using; expected one of ['°C', '°F', 'K'];
- received an invalid new state from sensor.beergarden_garden_tap_water_consumed : unknown HOT 6
- ValueError: Config entry has already been setup! HOT 6
- Issue adding Shelly PM Mini Gen 3 HOT 3
- Somfy Elixo 500 3S IO Pedestrian mode not available HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.