You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Operating System: MacOS (running NiPyApi in a Linux based Docker Image)
Description
Connections to TLS-secured (with custom certificates) NiFi fails after setting nipyapi.security.set_service_ssl_context - trying to get the service status times out (with bool_response=True) or fairly quickly with a urllib3 error if bool_response=False:
Cannot create a client socket with a PROTOCOL_TLS_SERVER context
From a quick look online, it seems there have been changes to the urllib3 / ssl library setup through recent versions of Python, which is possibly causing the problem:
This worked for me when creating an ssl_context manually with Purpose.SERVER_AUTH instead of the Purpose.CLIENT_AUTH that NiPyApi uses when a cert/key are specified in the nipyapi.security.set_service_ssl_context call.
What I Did
use SmallStep CA & CLI to create a custom CA and TLS certificates
run NiFi using the generate TLS certificates as Keystore & Truststore
create a user PKI set of certificates
configure NiPyApi with the user PKI cert & key using nipyapi.security.set_service_ssl_context
I assume it would be the same for NiFi Registry, although I haven't tested because I've been able to do everything I needed with NiFi Toolkit instead of NiPyApi.
Additional Note
If running NiFi with the "Single User" setup, and not having cert/key files available (they could probably be extracted from the auto-generated Keystore & Truststore, but I haven't), I've instead setup an unverified SSL Context:
A suggested approach might be to allow users to specify the Purpose for the SSL Context through the NiPyApi function - this would allow users to be more explicit for their version of Python (if such a background change is in fact what's caught me out here)
The text was updated successfully, but these errors were encountered:
Thanks for this detailed write up @ChrisSamo632
I think this highlights a missing set of tests in NiPy, as the current 'secure' test is really TLS/LDAP (a common requirement), but I think we should also be testing mTLS.
I will make a note to implement a docker test setup for mTLS and try to cover this case.
Description
Connections to TLS-secured (with custom certificates) NiFi fails after setting
nipyapi.security.set_service_ssl_context
- trying to get the service status times out (withbool_response=True
) or fairly quickly with aurllib3
error ifbool_response=False
:From a quick look online, it seems there have been changes to the
urllib3
/ssl
library setup through recent versions of Python, which is possibly causing the problem:This worked for me when creating an
ssl_context
manually withPurpose.SERVER_AUTH
instead of thePurpose.CLIENT_AUTH
that NiPyApi uses when acert
/key
are specified in thenipyapi.security.set_service_ssl_context
call.What I Did
nipyapi.security.set_service_ssl_context
To fix/workaround, I am instead:
I assume it would be the same for NiFi Registry, although I haven't tested because I've been able to do everything I needed with NiFi Toolkit instead of NiPyApi.
Additional Note
If running NiFi with the "Single User" setup, and not having cert/key files available (they could probably be extracted from the auto-generated Keystore & Truststore, but I haven't), I've instead setup an unverified SSL Context:
Urgency
Not urgent as I figured out a workaround.
A suggested approach might be to allow users to specify the
Purpose
for the SSL Context through the NiPyApi function - this would allow users to be more explicit for their version of Python (if such a background change is in fact what's caught me out here)The text was updated successfully, but these errors were encountered: