-
Notifications
You must be signed in to change notification settings - Fork 37
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 GossipOverHttps option to EventStoreClientConnectivitySettings #51
Conversation
8e461d1
to
9c27ce7
Compare
…o allow connecting to clusters using --insecure
9c27ce7
to
bb1c699
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.
Looks good and I've tested locally. I just have one comment about the naming of UseHttps
@@ -20,12 +20,14 @@ public class EventStoreClientConnectivitySettings { | |||
public DnsEndPoint[]? DnsGossipSeeds { get; set; } | |||
public IPEndPoint[]? IpGossipSeeds { get; set; } | |||
public TimeSpan GossipTimeout { get; set; } | |||
public bool UseHttps { get; set; } = 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.
Perhaps we should rename UseHttps
to make it more obvious that it only applies to gossip seeds, as it doesn't affect single node connection defaults right now.
As it stands, it looks like I could use the following to connect to a single node running with defaults and --insecure
:
ConnectivitySettings =
{
UseHttps = false
}
But the above results in SSL errors. I have to set the uri instead :
ConnectivitySettings =
{
Address = new Uri("http://localhost:2113")
}
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.
The other thing we can do here is infer that from Address
.
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.
@hayley-jean @thefringeninja good catch thanks , i'll try to see if we can infer it from Address so that it can be used both for single nodes and clusters
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.
@hayley-jean @thefringeninja what do you think about:
private bool _useHttps = true;
public bool UseHttps {
get{
return _useHttps;
}
set{
_useHttps = value;
Address = new UriBuilder{
Scheme = _useHttps ? Uri.UriSchemeHttps : Uri.UriSchemeHttp,
Host = Address.Host,
Port = Address.Port
}.Uri;
}
}
the good thing is that it would modify the Address
only if UseHttps
is set by the user
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.
@hayley-jean @thefringeninja after discussing with @pgermishuys , GossipOverHttps
might be a better name - technically speaking, it is not completely valid since we also use the flag to connect the the node (not only for gossip info) but it seems more intuitive from a user perspective and is consistent with GossipSeeds
and GossipTimeout
options
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.
Fixed in this commit: 983861d
Fixes #50
This PR allows the dotnet gRPC client to connect to a cluster running with --insecure (related PR: EventStore/EventStore#2556)