Skip to content

Connecting to nats server with tls enabled with certificate containig SAN as domain name, how to connect internally without tls or SAN verification. #5722

Answered by wallyqs
ekafe asked this question in Q&A
Discussion options

You must be logged in to vote

What you can also do is to use two certs, one for public traffic and one for internal traffic then setup both in the tls config block:

tls {
      certs = [
        {
          cert_file: # public cert
          key_file:  # ...
        },
        {
          cert_file: # internal cert
          key_file:  # ...
        }
      ]
}

if you want to use the Let's Encrypt certs for internal traffic then you could set an dns entry to resolves to an static cluster ip, for example with a nats deployment like this:

$ kubectl -n examples get svc

NAME                        TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)                              
nats-tls-example            ClusterIP   10.24…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ekafe
Comment options

@wallyqs
Comment options

Answer selected by ekafe
@ekafe
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants