我对使用Zscaler后面的Azure IoT Edge的连接性有问题。我知道我需要以某种方式在主机和码头容器上安装ZScaler证书。我能够在Ubuntu服务器上安装它,因为现在我看到绿色表示主机可以连接到azure-devices.net。但它仍然不能从集装箱网络连接。有人能给我详细介绍一下怎么做吗?据我所知,我应该向edgeHub和edgeAgent DockerFile提供这些信息,只是找不到它们。我需要建立新的形象吗?因为edgeAgent没有与云的连接,所以我无法修改部署清单中的任何内容。
发布于 2022-05-11 19:43:55
可以使用绑定将所需的证书装入edgeAgent和edgeHub容器。如果您使用的是边缘1.1或1.2,则安装的内容会有所不同。
对于Edge 1.1,您需要从容器上的/etc/ssl/certs复制ca-Cericates.crt文件,将Zscaler根证书( pem格式)附加到该文件,然后将其挂载到绑定为/etc/ssl/certs/ca-testicates.crt的每个容器。您的config.yaml应该如下所示:
agent:
name: “edgeAgent”
type: “docker”
env:”
https_proxy: “This should be the URL of your proxy server”
UpstreamProtocol: “AmqpWs” # Typically
config:
image: “mcr.microsoft.com/azureiotedge-agent:1.1” # Possibly
auth: {} # Typically
create_options:
# Following lines are added
host_config:
binds:
- /full/path/to/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt对于边缘1.2,需要生成OpenSSL用于查找正确根证书的证书的散列值。您可以使用以下命令来完成这一任务:
ln -s zscalerroot.crt `openssl x509 -hash -noout -in zscalerroot.crt`.0zscalerroot.crt是您的Zscaler根目录。这将创建一个具有八个十六进制数字的符号链接,然后是.0到您的zscaler证书。然后,您可以将Zscaler根证书绑定到/etc/openssl/certs,但在容器中使用您刚刚生成的名称命名它。您的config.toml应该类似于以下代码片段:
[agent.config]
image = “mcr.microsoft.com/azureiotedge-agent:1.1" # Possibly
# Bind added here
createOptions = { HostConfig = { Binds = [ “/full/path/to/zscaler.crt:/etc/ssl/certs/001122ff.0”] } }其中001122ff.0是由ln命令生成的名称。
您还需要将绑定添加到部署JSON中。当您使用set模块功能时,这将在Azure门户的运行时设置中。您需要将它添加到HostConfig中。
例如,对于低于1.1的edgeAgent:
{
"HostConfig": {
"Binds": [
"/full/path/to/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt"
],
}
}edgeAgent在1.2以下:
{
"HostConfig": {
"Binds": [
"/full/path/to/zscaler.crt:/etc/ssl/certs/001122ff.0"
],
}
}您还需要向edgeHub的运行时设置添加类似的绑定。
警告:我要用边缘1.1来处理这个问题。我还没有机会测试1.2。
https://stackoverflow.com/questions/71871323
复制相似问题