charlessolar / Aggregates.NET

.NET event sourced domain driven design model via NServiceBus and GetEventStore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ProjectionsManager is failing because there's no SSL certificate available.

AbdoDabbas opened this issue · comments

Hi again :),
In EventStore v20 they use TLS by default, so when I try to run EventStore without enabling TLS, on my dev machine, I face an exception about SSL connection and I figured out (by EventStore's users help) that if I'm not using secure connection I need to specify the HTTP schema in the ProjectionsManager creation like this:

var manager = new ProjectionsManager(client.Settings.Log, client.Settings.GossipSeeds[0].EndPoint, TimeSpan.FromSeconds(5), httpSchema: _httpSchema);

I cloned the source code of Aggregates.NET and did the changes needed and it worked !.
Two changes in file EventStoreConsumer.cs:

  1. In method EnableProjection I replaced:
var manager = new ProjectionsManager(connection.Settings.Log, connection.Settings.GossipSeeds[0].EndPoint, TimeSpan.FromSeconds(30));

With:

var httpSchema = GetHttpSchema(connection.Settings);

var manager = new ProjectionsManager(connection.Settings.Log, connection.Settings.GossipSeeds[0].EndPoint, TimeSpan.FromSeconds(30), httpSchema: httpSchema);
  1. In the method CreateProjection I did the same as the previous one.

  2. Method GetHttpSchema is as the following:

private string GetHttpSchema(ConnectionSettings settings)
{
	return settings.UseSslConnection ? "https" : "http";
}

What do you think? is that a correct solution for such an issue?

I couldn't do a push to the branch I did the fix on, so waiting for your response.

@AbdoDabbas
Ah I see, I wasnt aware the latest event store made this change.

Did you want to submit a pull request? I'll look into adding configuration settings to specify certs

@charlessolar Yes actually I did the fix that I mentioned and created a private package for my team in our Azure Feed, it worked but I'm not sure if it's the correct way to do it, but it works :).
If it's the correct way I can do a pull request if you grant me access, because I tried to push the new branch I created and I wasn't able to.

Ah I see, you only need to commit to the clone you created https://github.com/AbdoDabbas/Aggregates.NET then you can create a pull request from those changes!

Great, sorry this is my first time.

@charlessolar I did a pull request.