I started a node with your docker compose file, then wrote this small program:
internal class Program {
public static async Task<int> Main(string[] args) {
var provider = new ServiceCollection().AddSingleton(_ =>
new EventStoreClient(EventStoreClientSettings.Create("esdb://localhost:2113?tls=false")))
.BuildServiceProvider();
var client = provider.GetRequiredService<EventStoreClient>();
var e = await client.ReadAllAsync(Direction.Forwards, Position.Start, 1)
.FirstAsync();
await Console.Out.WriteLineAsync(new {
e.Event.EventStreamId,
e.Event.EventNumber,
e.Event.EventType
}.ToString());
return 0;
}
}
I omitted credentials here, as they will not be used when insecure=true
. Here is the output:
{ EventStreamId = $projections-$all, EventNumber = 0, EventType = $ProjectionsInitialized }
Are you calling AppContext.SetSwitch
in your code anywhere? The dotnet client will call AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true)
to make unencrypted HTTP/2 work. Changing this to false
can cause this error.