Reputation: 2080
I have been following these two resources for generating my certificates:
https://nifi.apache.org/docs/nifi-docs/html/toolkit-guide.html#tls_operation_modes
https://community.cloudera.com/t5/Community-Articles/Setting-Up-a-Secure-NiFi-to-Integrate-with-a-Secure-NiFi/ta-p/247765
Both look pretty straight forward. To note I'm running NiFi 1.10.0 on a remote server (no domain), Debian 9 (fresh instance) with java8. I have no domain name associated with the server just a public IP address.
On the server I tried generating my certificates with the following commands:
bin/tls-toolkit.sh standalone -n 'localhost' -C 'CN=sys_admin,OU=NIFI'
bin/tls-toolkit.sh standalone -n '0.0.0.0' -C 'CN=sys_admin,OU=NIFI'
bin/tls-toolkit.sh standalone -n 'my.server.ip.address' -C 'CN=sys_admin,OU=NIFI'
bin/tls-toolkit.sh standalone -n 'my.server.ip.address:9443' -C 'CN=sys_admin,OU=NIFI'
I updated my authorisers file accordingly. However I always get NET::ERR_CERT_REVOKED
error.
Running:
sudo openssl s_client -connect 0.0.0.0:9443 -showcerts -state -debug
I get the error:
Verification error: self signed certificate in certificate chain
Upvotes: 4
Views: 5527
Reputation: 1421
I assume you already know what OpenSSL is. So try the below commands to do it.
openssl req -x509 -newkey rsa:4096 -keyout key1.pem -out cert1.pem -days 3650 -subj "/C=US/ST=NAME_OF_STATE/L=NAME_OF_CITY/O=NAME_OF_ORGANIZATION/OU=NAME_OF_ORGANIZATION_UNIT/CN=*.nifi.apache.org/[email protected]"
openssl x509 -outform der -in cert1.pem -out cert1.crt
Explanation of Command One: You will get 2 output files. One is key1.pem and the second is cert1.pem which is generated using -out option. If you see closely the -subj option you will find the number of options quoted
localhost
and 127.0.0.1
. This is mandatory.
Explanation of Command Second: Cert1.pem needs to be converted into .CRT
file to import it into the trust store with the help command in the mail chain.
Upvotes: 0
Reputation: 33
I wasn't aware that a cert could bind to just an ip address.
However it sounds like it's not the best idea.
Here is a related question How to Generate a Self Signed SSL Certificate Bound to IP Address that backed away from binding a cert to an ip address.
I know it does not really answer your question but it sounds like you would be much better off getting a domain name and binding your self-signed cert to that. Alternatively you can get a real domain. I use Namecheap. It's really not very expensive. Especially if you pick one of the off-the-beaten-path TLD's. Also I would recommend using Let's Encrypt with Certbot to generate a real public cert. It's free and you will not have to worry about adding your fake CA or Intermediate cert to every machine you want to trust your site. Certbot pretty much makes generating public certs about as easy as it can get.
Upvotes: 1