Created 02-14-2018 10:04 AM
Hello,
I used the link for securing NIFI https://community.hortonworks.com/articles/58233/using-the-tls-toolkit-to-simplify-security.html and it works fine for POC.
In the above link I used tls-toolkit and it generates
CN=team_OU=NIFI.p12
CN=team_OU=NIFI.password nifi-cert.pem
nifi-key.key
keystore.jks
nifi.properties
truststore.jks
Next step , for production environment our IT registered domain name and generates <domain_name>.crt and <domain_name>.key
Question: how to switch NIFI use these files / certificates ( <domain_name>.crt and <domain_name>.key) ?
Thanks
Oleg.
Created 07-31-2018 06:57 AM
Is there a solution for this?
Created 08-19-2018 02:43 PM
I'd love a solution for this as well.
Created 09-12-2018 12:29 AM
NiFi cannot be configured to use a PEM encoded certificate file ( *.crt) and key file (*.key) directly. These files must be converted into Java Keystore (*.jks) files (or PKCS12 (*.p12) keystores, but JKS is preferred).
openssl
openssl pkcs12 -export -out keystore.p12 -in mydomain.crt
keytool -genkey -keyalg RSA -alias temp -keystore truststore.jks
keytool -delete -alias temp -keystore truststore.jks
keytool -import -v -trustcacerts -alias domain_ca -file domainCA.pem -keystore truststore.jks
keytool -genkey -keyalg RSA -alias temp -keystore keystore.jks
keytool -delete -alias temp -keystore keystore.jks
keytool -v -importkeystore -srckeystore keystore.p12 -srcstoretype PKCS12 -destkeystore keystore.jks -deststoretype JKS
You now have a
keystore.jks and truststore.jks file to use with NiFi. In nifi.properties, provide the paths to these files in nifi.security.keystore
and nifi.security.truststore
respectively, provide "JKS" as the value for nifi.security.keystoreType
and nifi.security.truststoreType
, and the respective password for each in nifi.security.keystorePasswd
and nifi.security.truststorePasswd
.
Obtaining the CA certificate
There are multiple ways to obtain the CA certificate containing the public key.
-----BEGIN CERTIFICATE-----
lines in the file, there are multiple certificates stored in itopenssl crl2pkcs7 -nocrl -certfile mydomain.crt | openssl pkcs7 -print_certs -text -noout
ca.domain.com
CAecho 'Q' | openssl s_client -connect letsencrypt.org:443 -showcerts
0 s:/CN=www.letsencrypt.org
i:/C=US/O=Let's Encrypt/CN=Let's Encrypt Authority X3
-----BEGIN CERTIFICATE----- MIIH5jCCBs6gAwIBAgISA2gSCm/BtvCR2e2bIap5YbXaMA0GCSqGSIb3DQEBCwUA ... l1Ou20Dm9TxnNw== -----END CERTIFICATE-----
Created 09-19-2019 10:32 AM
HI ,
Can you please let me know how to create client cert for authentication when CA cert is applied on Nifi Server end.
Created 10-31-2019 05:55 AM
Hi,
I used keystore explorer (https://keystore-explorer.org/downloads.html) to generate a client certificate from the server certificate. The server's intermediate CA public cert has to be in the truststore as well as the server certificate.
As for the user cert I sign it with the server cert, export as user.p12 and export the user cert. The trick is the extentions you have to add on the user cert. You can use this template with keystore explorer: https://drive.google.com/open?id=1k_BVTtNb8EcrKHDgOvnVMx-GevYZgQqF
The main thing is the basic constraints extention should be Subject is not a CA and the extended key usage should be for server and client auth
Created 08-13-2021 07:10 AM
- Convert the certificate from PEM to PKCS12 using openssl
- openssl pkcs12 -export -out keystore.p12 -in mydomain.crt
- Provide a strong password when prompted
I don't know if it's a version issue but I only got the first instruction working adding the " -inkey mydomain.key"
openssl pkcs12 -export -inkey mydomain.key -in mydomain.crt -out keystore.p12
The rest of the article is great. Thanks for the explanation