Hey folks,

I have a docker container running NiFi. I also have keycloak which acts as
an IAM. Now, I am using NiPyAPI inorder to connect to the NiFi instance.
I've mentioned the following in the code

```nipyapi.config.nifi_config.host = "https://nifi.local:9443/nifi/";
nipyapi.security.set_service_ssl_context(service='nifi',

 ca_file='/Users/<user>/tempnificerts/root-ca.pem',

 client_cert_file='/Users/<user>/tempnificerts/client-cert.pem',

 client_key_file='/Users/<user>/tempnificerts/client-key.pem',

 client_key_password='<password>')```


Here `/Users/<user>/tempnificerts/` is the place where the `.pem` files are
placed. `client-cert.pem` and `client-key.pem` were generated after
following the steps mentioned in `
https://gist.github.com/kevdoran/70447c312ca955c3a39b15cbfafb5123`. But
when I run the above code, it fails with the below error

```Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/nipyapi/security.py", line
130, in service_login
    username=username, password=password)
  File
"/usr/local/lib/python3.7/site-packages/nipyapi/nifi/apis/access_api.py",
line 67, in create_access_token
    (data) = self.create_access_token_with_http_info(**kwargs)
  File
"/usr/local/lib/python3.7/site-packages/nipyapi/nifi/apis/access_api.py",
line 148, in create_access_token_with_http_info
    collection_formats=collection_formats)
  File "/usr/local/lib/python3.7/site-packages/nipyapi/nifi/api_client.py",
line 326, in call_api
    _return_http_data_only, collection_formats, _preload_content,
_request_timeout)
  File "/usr/local/lib/python3.7/site-packages/nipyapi/nifi/api_client.py",
line 153, in __call_api
    _request_timeout=_request_timeout)
  File "/usr/local/lib/python3.7/site-packages/nipyapi/nifi/api_client.py",
line 371, in request
    body=body)
  File "/usr/local/lib/python3.7/site-packages/nipyapi/nifi/rest.py", line
268, in POST
    body=body)
  File "/usr/local/lib/python3.7/site-packages/nipyapi/nifi/rest.py", line
224, in request
    raise ApiException(http_resp=r)
nipyapi.nifi.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Date': 'Sun, 02 Jun 2019 09:23:13
GMT', 'X-Frame-Options': 'SAMEORIGIN', 'Content-Security-Policy':
"frame-ancestors 'self'", 'Cache-Control':
'must-revalidate,no-cache,no-store', 'Content-Length': '0', 'Server':
'Jetty(9.4.11.v20180605)'})```

Can someone please guide me on this?

Reply via email to