Skip to content
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

[Jetstream] Allow TLS Client Authentication #1923

Closed
NickLarsenNZ opened this issue Aug 2, 2022 · 1 comment · Fixed by #1924
Closed

[Jetstream] Allow TLS Client Authentication #1923

NickLarsenNZ opened this issue Aug 2, 2022 · 1 comment · Fixed by #1924
Milestone

Comments

@NickLarsenNZ
Copy link
Contributor

Looking at the docs, and the configuration struct for Jetstream, it doesn't seem like TLS Client Authentication can be used.

type metadata struct {
natsURL string
jwt string
seedKey string
name string
durableName string
queueGroupName string
startSequence uint64
startTime time.Time
deliverAll bool
flowControl bool
}

I wonder if it is a trivial addition?

@NickLarsenNZ NickLarsenNZ changed the title [Jetstream Authentication] Allow TLS Client Authentication [Jetstream] Allow TLS Client Authentication Aug 2, 2022
@NickLarsenNZ
Copy link
Contributor Author

Looks like an else if could be added here:

// Set nats.UserJWT options when jwt and seed key is provided.
if js.meta.jwt != "" && js.meta.seedKey != "" {
opts = append(opts, nats.UserJWT(func() (string, error) {
return js.meta.jwt, nil
}, func(nonce []byte) ([]byte, error) {
return sigHandler(js.meta.seedKey, nonce)
}))
}

And the NATS client has an example of connecting via TLS:

https://github.com/nats-io/nats.go#tls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants