Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[In Progress] NIFI Secure Connection failed with certificate #329

Open
maykiwo opened this issue Aug 23, 2023 · 6 comments
Open

[In Progress] NIFI Secure Connection failed with certificate #329

maykiwo opened this issue Aug 23, 2023 · 6 comments

Comments

@maykiwo
Copy link

maykiwo commented Aug 23, 2023

  • Nipyapi version: nipyapi-0.19.1
  • NiFi version: 1.16.0
  • NiFi-Registry version:
  • Python version: 3.8
  • Operating System: Centos

Description

I have a nifi standalone 1.16.0 running securely. I generated self signed certificate using nifi-toolkit and provided the cert/key files in below code but secure connection is failing

What I Did

import nipyapi
import urllib3

if __name__ == '__main__':
    
   
    urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

    nipyapi.config.nifi_config.host = 'https://localhost:9091/nifi-api'
    nipyapi.config.nifi_config.key_file = '../cert/cert.key'
    nipyapi.config.nifi_config.cert_file = '/../cert/cert.cer'
    nipyapi.config.nifi_config.ssl_ca_cert = '../cert/cacerts.cer'
    nipyapi.config.nifi_config.verify_ssl = False
    nipyapi.config.registry_config.host = 'https://localhost:19091/nifi-registry-api'

    nipyapi.canvas.get_root_pg_id()

And get error :

/usr/lib/python3/dist-packages/requests/__init__.py:89: RequestsDependencyWarning: urllib3 (2.0.4) or chardet (3.0.4) doesn't match a supported version! warnings.warn("urllib3 ({}) or chardet ({}) doesn't match a supported "

Urgency

Testing nipyapi

@ottobackwards
Copy link
Contributor

This is not a nipyapi error, it has to do with your python installation.
The error is saying that the requests package cannot satisfy it's version dependency for either urllib or chardet.
You probably need to look with pip at what you have installed for all of those things and maybe force the install of the required version.
If you are not working in a virtual env, you may want to, that way you can just install the versions you need for this app and not mess anything else up.

@maykiwo
Copy link
Author

maykiwo commented Aug 24, 2023

Thanks a lot for quick reply

@maykiwo maykiwo changed the title NIFI Secure Connection failed with certificate [Closed] NIFI Secure Connection failed with certificate Aug 24, 2023
@maykiwo
Copy link
Author

maykiwo commented Aug 24, 2023

One thing why I got the issue for nifi registry, normally it is used the same client certificate, and with curl it is working.

Do i need add something more ?

WARNING:urllib3.connectionpool:Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fbfe0f6c130>: Failed to establish a new connection: [Errno 111] Connection refused')': /nifi-registry-api/buckets

@ottobackwards
Copy link
Contributor

I'm not sure about that. @Chaffelson ?

@Chaffelson
Copy link
Owner

This is usually the response when the authenticated user does not have permissions - an authorization error, rather than an authentication one. Have you given the user the appropriate permissions in Registry to match those in NiFi?

@maykiwo maykiwo changed the title [Closed] NIFI Secure Connection failed with certificate [In Progress] NIFI Secure Connection failed with certificate Aug 25, 2023
@maykiwo
Copy link
Author

maykiwo commented Aug 25, 2023

Thanks @Chaffelson

Yes, before use NiPyApi, I have already done the curl command to "nifi-registry-api/buckets" and it works. I got the result so it is not a permission issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants