Objective
Because of Nifi integration with other tools through HTTP, I have to make ListenHTTP
processor public facing. API Gateway on all 3 environments is too expensive for me. So I closed all VM ingress ports (except the one needed for ListenHTTP
) for outer networks.
Issue
My configuration of ListenHTTP
with StandardRestrictedSSLContextService
doesn't work. Without SSL it worked, but was unsecure.
user$ curl -X POST -H "Content-Type: application/json" --data "test" https://localhost:7070/test
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (60) SSL certificate problem: self signed certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
.....
user$ curl -X POST -H "Content-Type: application/json" --data "test" --cacert cacerts.jks https://localhost:7070/test
curl: (77) error setting certificate verify locations:
CAfile: cacerts.jks
CApath: none
Question
How to make ListenHTTP
work with SSL certificates? What am I doing wrong?
More detailed questions:
- Should I copy cacerts.jsk to the machine from which I issue the query? As far as I understand,
StandardRestrictedSSLContextService
will verify if the client has certificate in TrustStore. - If I need to protect only a single port with
ListenHTTP
processor - then I don't need nifi.security.needClientAuth property or all environment variables defined at "Standalone Instance, Two-Way SSL" section, right? I'm little bit confused because both Docker Image andStandardRestrictedSSLContextService
contains the same configs, i.e. KEYSTORE_TYPE.
Already done
- I have a general idea about KeyStore & TrustStore from this question and the documentation.
- I have launched Nifi Docker container v1.10.0 with up & running
ListenHTTP
processor on 7070 port. - I have created keystore.jks and cacerts.jks files due to the instruction inside Nifi container.
- I have configured
ListenHTTP
to useStandardRestrictedSSLContextService
controller with the following configs:.