跨平台代理VIP认证错误
Cross-platform Agent VIP Authentication Error
我在让两个代理跨平台通信时遇到问题。
我在一个内部网络上有两台虚拟机 运行,其中一台虚拟机有一个代理尝试连接并发布到另一台虚拟机上的平台。连接和发送的代码与 ForwarderAgent 等示例中的代码相同。我知道代理可以看到对方,并尝试连接,但身份验证失败。
在我尝试连接的平台上,我可以看到发布代理向自己展示的凭据。但是,提供的凭据是在
中生成的私钥
$VOLTTRONHOME/keystores/
每次我启动代理。所以每次我启动代理时,凭据都会改变。
如果我不知道代理将尝试使用的凭据,我不确定如何预先将代理添加为已知身份。
我已将不同的地址添加为 known_hosts,并尝试使用与其代理安装关联的 public 密钥在两个平台之间注册代理
volttron-ctl auth add
但是发送代理仍然向自己展示新的凭据。是否有我遗漏的配置步骤,以便代理将使用其一致的 public 密钥发布?
创建代理以从已安装的代理连接到外部平台时,您应该使用以下内容作为操作指南
````
import gevent
from volttron.platform.vip.agent import Agent
destination_vip="tcp://127.0.0.5:22916?serverkey=dafn..&publickey=adf&secretkey=afafdf"
event = gevent.event.Event()
# Note by specifying the identity, the remote platform will use the same
# keystore to authenticate the agent. Otherwise a guid is used which
# changes keys each time.
agent = Agent(address=destination_vip, enable_store=False, identity="remote_identity")
gevent.spawn(agent.core.run)
if not event.wait(timeout=10):
print("Unable to start agent!"
````
请注意,这是来自 https://github.com/VOLTTRON/volttron/blob/master/services/core/ForwardHistorian/forwarder/agent.py#L317,但是有一种不同的机制不需要包含 destination_vip 地址 public 和开发中的密钥.
此外,您在上述代码中提到的 public 密钥确实需要在 auth.json 文件中 and/or 您需要允许通过 / 的所有连接。*/在 auth.json 文件中。
希望对您有所帮助!
我在让两个代理跨平台通信时遇到问题。
我在一个内部网络上有两台虚拟机 运行,其中一台虚拟机有一个代理尝试连接并发布到另一台虚拟机上的平台。连接和发送的代码与 ForwarderAgent 等示例中的代码相同。我知道代理可以看到对方,并尝试连接,但身份验证失败。
在我尝试连接的平台上,我可以看到发布代理向自己展示的凭据。但是,提供的凭据是在
中生成的私钥$VOLTTRONHOME/keystores/
每次我启动代理。所以每次我启动代理时,凭据都会改变。
如果我不知道代理将尝试使用的凭据,我不确定如何预先将代理添加为已知身份。
我已将不同的地址添加为 known_hosts,并尝试使用与其代理安装关联的 public 密钥在两个平台之间注册代理
volttron-ctl auth add
但是发送代理仍然向自己展示新的凭据。是否有我遗漏的配置步骤,以便代理将使用其一致的 public 密钥发布?
创建代理以从已安装的代理连接到外部平台时,您应该使用以下内容作为操作指南
````
import gevent
from volttron.platform.vip.agent import Agent
destination_vip="tcp://127.0.0.5:22916?serverkey=dafn..&publickey=adf&secretkey=afafdf"
event = gevent.event.Event()
# Note by specifying the identity, the remote platform will use the same
# keystore to authenticate the agent. Otherwise a guid is used which
# changes keys each time.
agent = Agent(address=destination_vip, enable_store=False, identity="remote_identity")
gevent.spawn(agent.core.run)
if not event.wait(timeout=10):
print("Unable to start agent!"
````
请注意,这是来自 https://github.com/VOLTTRON/volttron/blob/master/services/core/ForwardHistorian/forwarder/agent.py#L317,但是有一种不同的机制不需要包含 destination_vip 地址 public 和开发中的密钥.
此外,您在上述代码中提到的 public 密钥确实需要在 auth.json 文件中 and/or 您需要允许通过 / 的所有连接。*/在 auth.json 文件中。
希望对您有所帮助!