我在码头集装箱里运行HA。我已经创建了一个通配符自签名证书,我在我的主页的其他地方使用。但我不能让它在医管局内运作。下面是我如何使用openSSL创建自己的证书
Create CA - Root Key
openssl genrsa -aes256 -out ca-key.pem 4096
Create Request
openssl req -new -x509 -sha256 -days 3650 -key ca-key.pem -out ca.pem
Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:OH
Locality Name (eg, city) []:Cortland
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Real World Developers
Organizational Unit Name (eg, section) []:Internal
Common Name (e.g. server FQDN or YOUR name) []:RWD.com
Email Address []:realworlddevs@outlook.com
Create Server Cert Signing Request
create key
openssl genrsa -out cert-key.pem 4096
create request
openssl req -new -sha256 -subj "/CN=RealWorldDevelopers" -key cert-key.pem -out cert.csr (subject=anything)
create config
echo "subjectAltName=DNS:*.RWD.com,IP:192.168.50.10" >> extfile.cnf (powershell will at BOM - need to open with notepad++ and set to UTF8)
create cert
openssl x509 -req -sha256 -days 3650 -in cert.csr -CA ca.pem -CAkey ca-key.pem -out cert.pem -extfile extfile.cnf -CAcreateserial我还运行Pi作为我的本地DNS.在没有证书的情况下,我的DNS路由在我的家乡ha.rwd.com内是很好的。
我的configuration.yaml文件包含http节点,如下所示
# TLS Certs
http:
ssl_certificate: /config/fullchain.pem
ssl_key: /config/cert-key.pem配置中的间隔是正确的。证书位于容器内的配置文件夹中。
但在我的日志里,我还是明白:
"/usr/src/homeassistant/homeassistant/components/http/init.py",
2022-09-12 18:55:41.931 _create_ssl_context context.load_cert_chain中的homeassistant.setup错误(最近一次调用):_create_ssl_context context.load_cert_chain(self.ssl_certificate,上面的异常是导致以下异常的直接原因:追溯(最近一次调用):文件"/usr/src/homeassistant/homeassistant/setup.py",第235行,在_async_setup_component结果=等待任务文件"/usr/src/homeassistant/homeassistant/components/http/init.py",行180,在“等待文件”中,“等待”( File "/usr/src/homeassistant/homeassistant/components/http/init.py",Line272),在“等待”( async_initialize self.context )中=“等待”(async_initialize self.hass.async_add_executor_job)(文件"/usr/local/lib/python3.10/concurrent/futures/thread.py",行58,在运行结果中= self.fn(*self.args,**self.kwargs)文件"/usr/src/homeassistant/homeassistant/components/http/init.py",行358,在_create_ssl_context HomeAssistantError中( homeassistant.exceptions.HomeAssistantError:不能使用/config/Fulchain.pem: SSL (_ssl.c:3874) 2022-09-12 18:55:41.933错误(MainThread) homeassistant.setup )无法设置api的依赖项。安装失败: http 2022-09-12 18:55:41.935错误(MainThread) homeassistant.setup安装失败:(DependencyError(.),‘无法设置依赖项: http') 2022-09-12 18:55:41.936错误(MainThread) homeassistant.setup无法设置auth的依赖项。安装失败: http 2022-09-12 18:55:41.936错误(MainThread) homeassistant.setup安装失败:(DependencyError(.),‘不能设置依赖项: http')
发布于 2022-10-11 08:03:48
坞容器中的主助理,所以您必须添加挂载: Commandline,从而将certs目录的路径添加到docker:
--mount type=bind,source=/certdirectory,target=/config/ssl码头工人组成:
volumes:
- type: bind
source: /certdirectory
target: /config/ssl或者使用维护者GUI (必须安装)
然后修改configuration.yaml:
http:
ssl_certificate: /config/ssl/fullchain.pem
ssl_key: /config/ssl/cert-key.pemhttps://stackoverflow.com/questions/73696283
复制相似问题