Question

I have a derived class of WebClient that overrides WebRequest to return a request object with the certificate needed to talk to our ElasticSearch cluster via proxy. How do I use this with Nest? Thanks.

Was it helpful?

Solution

You can subclass Connection

https://github.com/Mpdreamz/NEST/blob/master/src/Nest/Domain/Connection/Connection.cs

And override

protected override HttpWebRequest CreateWebRequest(string path, string method)
{
       //return your derived WebRequest here.
}

then use this overload on ElasticClient

https://github.com/Mpdreamz/NEST/blob/master/src/Nest/ElasticClient.cs#L29

To use your custom IConnection.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top