mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Merge pull request #901 from philipbl/ssl
Increase security of using SSL
This commit is contained in:
commit
bc88985889
@ -112,10 +112,10 @@ class HomeAssistantHTTPServer(ThreadingMixIn, HTTPServer):
|
|||||||
_LOGGER.info("running http in development mode")
|
_LOGGER.info("running http in development mode")
|
||||||
|
|
||||||
if ssl_certificate is not None:
|
if ssl_certificate is not None:
|
||||||
wrap_kwargs = {'certfile': ssl_certificate}
|
context = ssl.create_default_context(
|
||||||
if ssl_key is not None:
|
purpose=ssl.Purpose.CLIENT_AUTH)
|
||||||
wrap_kwargs['keyfile'] = ssl_key
|
context.load_cert_chain(ssl_certificate, keyfile=ssl_key)
|
||||||
self.socket = ssl.wrap_socket(self.socket, **wrap_kwargs)
|
self.socket = context.wrap_socket(self.socket, server_side=True)
|
||||||
|
|
||||||
def start(self):
|
def start(self):
|
||||||
""" Starts the HTTP server. """
|
""" Starts the HTTP server. """
|
||||||
|
Loading…
x
Reference in New Issue
Block a user