-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add tls support #33
Add tls support #33
Conversation
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
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.
Just few comments (to my own code, I know :))
@@ -70,6 +75,27 @@ public class ClientOptions { | |||
return self | |||
} | |||
|
|||
public func enforceTls() -> ClientOptions { |
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.
This was a placeholder name. Let's rename to requireTls
@@ -70,6 +75,27 @@ public class ClientOptions { | |||
return self | |||
} | |||
|
|||
public func enforceTls() -> ClientOptions { | |||
self.withTls = true |
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.
and maybe for consistency rename then that one too?
tlsConfiguration.privateKey = .privateKey(privateKey) | ||
} | ||
let sslContext = try NIOSSLContext(configuration: tlsConfiguration) | ||
// FIXME(jrm): Consider better way to pick hostname. |
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.
How do we pick the hostname in Go?
We discussed it a bit - but maybe we should pick the hostname of the URL we are currently trying to connect to?
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.
Agreed, but currently we always pick the first url anyway. I'll add url randomization in the next PR and use that one.
Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
5fa7874
to
cf2703f
Compare
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.
LGTM!
No description provided.