-
-
Notifications
You must be signed in to change notification settings - Fork 7
docs: Document workaround to disable SNI checks #834
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
base: main
Are you sure you want to change the base?
Changes from all commits
255dcdf
a72b3ca
15660c6
c519480
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -22,9 +22,16 @@ spec: | |||||||||
|
||||||||||
== `HTTP ERROR 400 Invalid SNI` | ||||||||||
|
||||||||||
You are very likely accessing a NiFi >= 2.0 stacklet using HTTPS to secure its WebUI and an Ingress in front of it. | ||||||||||
The URL requested by the ingress-controller (such as nginx) needs to be the FQDN of the nifi service, not only the service name. | ||||||||||
You can instruct nginx ingress to use the FQDN by setting the following annotation: | ||||||||||
This error occurs when accessing NiFi 2.0 or later, which enforces https://en.wikipedia.org/wiki/Server_Name_Indication[SNI (Server Name Indication){external-link-icon}^] validation for HTTPS connections. | ||||||||||
The hostname in the request must match one of the hostnames in NiFi's TLS certificate. | ||||||||||
|
||||||||||
NOTE: For complete technical background, see the https://issues.apache.org/jira/browse/NIFI-14858[upstream issue NIFI-14858{external-link-icon}^]. | ||||||||||
|
||||||||||
=== When using Ingress | ||||||||||
|
||||||||||
If you're accessing NiFi through an Ingress controller, the ingress must forward requests using the FQDN of the NiFi service, not just the service name. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The controller doesn't necessarily handle traffic (eg: AWS Load Balancer Controller), and applies to more the Ingress (eg: Service, Gateway).
Suggested change
|
||||||||||
|
||||||||||
For nginx ingress, configure the `upstream-vhost` annotation to use the service FQDN: | ||||||||||
|
||||||||||
[source,yaml] | ||||||||||
---- | ||||||||||
|
@@ -53,7 +60,36 @@ spec: | |||||||||
# ... | ||||||||||
---- | ||||||||||
|
||||||||||
For details please read on https://medium.com/@chnzhoujun/how-to-resolve-sni-issue-when-upgrading-to-nifi-2-0-907e07d465c5[this article]. | ||||||||||
For additional details, see https://medium.com/@chnzhoujun/how-to-resolve-sni-issue-when-upgrading-to-nifi-2-0-907e07d465c5[this article{external-link-icon}^]. | ||||||||||
|
||||||||||
=== When using Load Balancers or other proxies | ||||||||||
|
||||||||||
When Load Balancers, API Gateways, or other proxy tools sit in front of NiFi, they may forward requests with hostnames that don't match NiFi's TLS certificates. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
or
Suggested change
|
||||||||||
This commonly occurs because: | ||||||||||
|
||||||||||
* The proxy uses a different hostname than what's in NiFi's certificate | ||||||||||
* NiFi is unaware of the external hostnames used to reach the proxy | ||||||||||
* Certificate management in Kubernetes makes it complex to include all possible hostnames | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I disagree here. It makes it difficult (to impossible) to add the dynamically assigned DNS name (for example, what AWS assigns to the Load Balancer, but that name isn't meant to be used directly - it is there for DNS records with the well-known name(s) to point to). What is true here is that secret-operator doesn't allow other names to be added to the certificate (see stackabletech/secret-operator#630). |
||||||||||
|
||||||||||
==== Workaround: Disable SNI validation | ||||||||||
|
||||||||||
Since this scenario is common and difficult to resolve through certificate management, you can disable SNI validation in NiFi: | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is through our own fault (well, secret-operator not supporting external names), so I think we need to revise this:
Suggested change
|
||||||||||
|
||||||||||
[source,yaml] | ||||||||||
---- | ||||||||||
nodes: | ||||||||||
configOverrides: | ||||||||||
nifi.properties: | ||||||||||
nifi.web.https.sni.required: "false" | ||||||||||
sbernauer marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
nifi.web.https.sni.host.check: "false" | ||||||||||
---- | ||||||||||
|
||||||||||
These properties control NiFi's SNI validation behavior: | ||||||||||
|
||||||||||
* `nifi.web.https.sni.required`: When `true`, NiFi requires that HTTPS requests include an SNI certificate. Setting to `false` allows connections without SNI certificates. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
* `nifi.web.https.sni.host.check`: When `true`, NiFi validates that the SNI certificate's hostname matches the incoming request's hostname. Setting to `false` disables this hostname matching check. | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might need to check this: Does the SNI Check check that the There is no SNI Certificate, so I'll rewrite that part, but we still need to ensure it is valid for Jetty 10.
Suggested change
If we aren't sure about the host header matching, then:
Suggested change
I'm also trying to work out how we can mention Proxy Protocol v2 (PP2) in there... because load balancers can take the original It's hard to validate that until we can have secret-operator add external Subject names. So maybe we can leave that for later. |
||||||||||
|
||||||||||
WARNING: Disabling SNI validation reduces security by allowing connections with mismatched hostnames. Only use this workaround when proper certificate configuration is not feasible. | ||||||||||
|
||||||||||
== `authorization_request_not_found` when using multiple NiFi nodes | ||||||||||
|
||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, this could go away with stackabletech/secret-operator#630, but might also require setting the external name in the NiFi properties.
No action needed, just mentioning it to keep it in people's minds.