Good evening, I am having a lot of trouble getting an instance of NiFi running with Mutual TLS. I have different errors depending on whether the effort involves version 1.xx or version 2.xx. I'm hoping to get some help. This is all being attempted via Docker.
My YAML:
```
version: "3.9"
services:
nifi:
image: apache/nifi:1.24.0
# hostname: nifi
container_name: nifi
ports:
# - 8443:8443
- "9449:9449"
environment:
- NIFI_WEB_HTTPS_PORT=9449
- NIFI_WEB_HTTPS_HOST=0.0.0.0
- NIFI_WEB_PROXY_HOST=localhost,localhost:9449,192.168.1.56,192.168.1.56:9449
- AUTH=tls
- KEYSTORE_PATH=/opt/nifi/nifi-current/certs/jks/nifi-ks.jks
- KEYSTORE_TYPE=JKS
- KEYSTORE_PASSWORD=randomPassword
- TRUSTSTORE_PATH=/opt/nifi/nifi-current/certs/jks/truststore.jks
- TRUSTSTORE_PASSWORD=randomPassword
- TRUSTSTORE_TYPE=JKS
- INITIAL_ADMIN_IDENTITY='CN=admin'
- NIFI_SENSITIVE_PROPS_KEY=randomKey
volumes:
- nifi_flowfile_repo:/opt/nifi/nifi-current/flowfile_repository
- nifi_content_repo:/opt/nifi/nifi-current/content_repository
- nifi_provenance_repo:/opt/nifi/nifi-current/provenance_repository
- nifi_conf:/opt/nifi/nifi-current/conf
- nifi_db:/opt/nifi/nifi-current/database_repository
- /opt/nifi-custom-setup/version_2-0-0/20240130/certs/ca-openssl:/opt/nifi/nifi-current/certs
- /opt/nifi-custom-setup/version_2-0-0/add_nars:/opt/nifi/nifi-current/add_nars
- /mnt/scripts:/opt/nifi/nifi-current/custom_scripts
- /mnt/datashare_source_data2:/mnt/datashare_source_data2
- /mnt/drivers/postgresql-42.6.0.jar:/opt/nifi/nifi-current/lib/postgresql-42.6.0.jar
- /usr/local/bin:/usr/local/bin:ro
- /usr/local/lib:/usr/local/lib:ro
# entrypoint: ["/bin/bash", "/opt/nifi/nifi-current/custom_scripts/custom_entrypoint.sh"]
restart: unless-stopped
volumes:
nifi_flowfile_repo:
nifi_content_repo:
nifi_provenance_repo:
nifi_conf:
nifi_db:
```
relevant initial logs when the container boots up:
```
2024-01-31 00:20:34,016 INFO [main] org.eclipse.jetty.server.Server Started @31422ms
2024-01-31 00:20:34,031 INFO [main] org.apache.nifi.web.server.JettyServer NiFi has started. The UI is available at the following URLs:
2024-01-31 00:20:34,031 INFO [main] org.apache.nifi.web.server.JettyServer https://0.0.0.0:9449/nifi
```
Error from the web browser when I attempt to log in (It does successfully prompt me for my .p12 certificate and that seems to work.)
Insufficient Permissions
Unable to view the user interface. Contact the system administrator.
Error from within the container related to the above:
```
ifi@8c3733a74f02:/opt/nifi/nifi-current/logs$ cat nifi-user.log
2024-01-31 00:20:41,209 INFO [NiFi Web Server-32] o.a.n.w.s.NiFiAuthenticationFilter Authentication Started 192.168.1.1 [CN=admin] GET
https://ddla.w.ccu:9449/nifi-api/flow/current-user2024-01-31 00:20:41,209 INFO [NiFi Web Server-32] o.a.n.w.s.NiFiAuthenticationFilter Authentication Success [CN=admin] 192.168.1.1 GET
https://ddla.w.ccu:9449/nifi-api/flow/current-user2024-01-31 00:20:41,252 INFO [NiFi Web Server-32] o.a.n.w.a.c.AccessDeniedExceptionMapper identity[CN=admin], groups[] does not have permission to access the requested resource. Unable to view the user interface. Returning Forbidden response.
nifi@8c3733a74f02:/opt/nifi/nifi-current/logs$ ```
The relevant portion from the `authorizers.xml` file:
```
<!-- <authorizer>
<identifier>file-provider</identifier>
<class>org.apache.nifi.authorization.FileAuthorizer</class>
<property name="Authorizations File">./conf/authorizations.xml</property>
<property name="Users File">./conf/users.xml</property>
<property name="Initial Admin Identity">'CN=admin'</property>
<property name="Legacy Authorized Users File"></property>
<property name="Node Identity 1"></property>
</authorizer>
```
A printout of the .p12 contents via `keytool`:
```
Keystore type: PKCS12
Keystore provider: SUN
Your keystore contains 1 entry
Alias name: admin
Creation date: Jan 30, 2024
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=admin
Issuer: CN=nifi-ca
```
Pivoting slightly, when I attempt to use the same YAML, but use the following image:
apache/nifi:2.0.0-M1
I get a completely different error. I get an Invalid SNI error.
If there is anything you could do to point me in the right direction, I would greatly appreciate it.