# \[Elasticsearch.NET 7\] Breaking change on HttpConnection - how to solve?

**URL:** <https://discuss.elastic.co/t/elasticsearch-net-7-breaking-change-on-httpconnection-how-to-solve/206940>\
**Category:** Elasticsearch\
**Created:** [November 7, 2019, 9:55am UTC](https://discuss.elastic.co/t/elasticsearch-net-7-breaking-change-on-httpconnection-how-to-solve/206940 "2019-11-07T09:55:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankona](https://avatars.discourse-cdn.com/v4/letter/a/8491ac/32.png) [@Ankona](https://discuss.elastic.co/u/Ankona)\
**Post date:** [November 7, 2019, 9:55am UTC](https://discuss.elastic.co/t/elasticsearch-net-7-breaking-change-on-httpconnection-how-to-solve/206940/1 "2019-11-07T09:55:07Z")

</div>

Hi,  
I am using a hack to solve some internal ssl issues (self signed certificates at dev and environments)

By updating the libraries from NEST 6.x to 7.4.0 my code is broken by a breaking change.

I am using a class derived from HttpConnection and overriding the CreateHttpClientHandler method. (Setting the ServerCertificateCustomValidationCallback property on the HttpClientHandler)

But, in the new version of the library this method is changed, it is now returning a HttpMessageHandler object. (For some reason the method is still called "CreateHttpClientHandler"....)

My question:  
Is there still a way to set the ServerCertificateCustomValidationCallback on the HttpClientHandler object?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 5, 2019, 9:55am UTC](https://discuss.elastic.co/t/elasticsearch-net-7-breaking-change-on-httpconnection-how-to-solve/206940/2 "2019-12-05T09:55:08Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [April 8, 2020, 11:35am UTC](https://discuss.elastic.co/t/elasticsearch-net-7-breaking-change-on-httpconnection-how-to-solve/206940/3 "2020-04-08T11:35:53Z")

</div>

Hi @Ankona,

Have you seen the [`ServerCertificateValidationCallback` method on `ConnectionSettings`](https://www.elastic.co/guide/en/elasticsearch/client/net-api/current/working-with-certificates.html)? It allows you to pass a delegate to use for certificate validation, without needing to derive your own `HttpConnection`.
