-
Forward Warning: I take it for granted that the nats-server does indeed support having different clients connect to it using their own encryption-decryption schemes/keys. If I'm missing something please feel free to point it out. Essentially what the subject says. Consider for instance the following two scenarios for nats-based communication: Scenario#1:
In this scenario I assume that that nats-server will decrypt messages published by (P) using decryption scheme (A) examine the subject and forward "foo.bar" messages over to consumer (C) after having re-encrypted these messages using encryption-scheme (B). Scenario#2:
In this scenario I assume that that nats-server would only need to decrypt just the subject of the message published by (P) using decryption scheme (A) and after examining the subject it would forward "foo.bar" messages over to consumer (C) by "copy-pasting" the payload (data) of the message "as-is" since the encryption-decryption mechanism is the exact same. I guess this symmetry in encryption-decryption should lead to a considerable performance boost when the load is high. Am I right in these assumptions? Or do I miss something? I haven't seen anyone pointing out scenario#2 as a means to boost performance and reduce latency (potentially reducing error rates as well). Thoughts? Insights? Links to relevant documentation? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
NATS does not do encrypt/decrypt at the NATS Protocol [1] (Layer 7) level as in your assumption. "On the wire" NATS does fully support TLS with NATS clients [2]. As TLS terminates at a NATS server, in affect, NATS is playing a pattern as in Scenario 1 (i.e. 1..N subscribing NATS Clients have independent TLS connections and keys). [1] https://docs.nats.io/reference/reference-protocols/nats-protocol#client-protocol |
Beta Was this translation helpful? Give feedback.
NATS does not do encrypt/decrypt at the NATS Protocol [1] (Layer 7) level as in your assumption. "On the wire" NATS does fully support TLS with NATS clients [2]. As TLS terminates at a NATS server, in affect, NATS is playing a pattern as in Scenario 1 (i.e. 1..N subscribing NATS Clients have independent TLS connections and keys).
[1] https://docs.nats.io/reference/reference-protocols/nats-protocol#client-protocol
[2] https://docs.nats.io/using-nats/developer/security/tls