针对远程 NIFI 保护 minifi c++ 代理

Securing minifi c++ agent against remote NIFI

我有一个远程 3 节点安全 NIFI 服务器,我想通过 MINIFI C++ 代理向其发送一些数据。我试图了解为 MINIFI(客户端)生成和签署证书的机制,但我找不到详细的文档。

我看到以下配置:

#nifi.security.need.ClientAuth=
#nifi.security.client.certificate=
#nifi.security.client.private.key=
#nifi.security.client.pass.phrase=
#nifi.security.client.ca.certificate=

但是如何生成 client.pem 并签名?

编辑: 这是我尝试做的(自签名),但是失败了:

[2020-08-14 07:19:08.872] [org::apache::nifi::minifi::utils::HTTPClient] [error] curl_easy_perform() failed SSL connect error

[2020-08-14 07:19:08.872] [org::apache::nifi::minifi::RemoteProcessorGroupPort] [error] ProcessGroup::refreshRemoteSite2SiteInfo -- curl_easy_perform() failed 
cd $HOME
openssl req -new -newkey rsa:4096 -nodes -keyout machine.key -out machine.csr
openssl x509 -req -sha256 -days 365 -in machine.csr -signkey machine.key -out machine.pem

###
Downloaded the public certificate from the server into ---> $HOME/server.crt


nifi.security.need.ClientAuth=true
nifi.security.client.certificate=$HOME/machine.pem
nifi.security.client.private.key=$HOME/machine.key
nifi.security.client.pass.phrase=password
nifi.security.client.ca.certificate=$HOME/server.crt

有很多方法可以生成 X.509 证书并对其进行签名(openssl, TinyCert, Let's Encrypt, NiFi TLS Toolkit,等等)。重要的要求是证书是明确信任(public证书导入到NiFi信任库)或隐式信任(签名链中的任何 public 个证书都存在于 NiFi 信任库中。

一种方法是遵循 walkthrough for deploying a secure NiFi cluster and use the TLS Toolkit to generate a client keystore, then export the certificate and key from that keystore to PEM format using these commands