# \[BUG-16787\] system.net.httpClient() HttpClient.Version customizer

**URL:** <https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [September 28, 2020, 7:17pm UTC](https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138 "2020-09-28T19:17:35Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [September 28, 2020, 7:17pm UTC](https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138/1 "2020-09-28T19:17:35Z")

</div>

I need to set my http clients version, similar to:

```auto
HttpClient.newBuilder()
    .version(Version.HTTP_1_1)

```

so I defined a customizer function to set it, but I cannot for the life of me figure out what I need to import or define so that I can specify the version parameter needed in the .version method.

Here is my callable, but I just cant seem to figure it out.

```auto
def clientCustomizer(client):
	return client.version(HttpClient.Version.versionOf("HTTP_1_1"))

```

If anyone has any ideas they are greatly appreciated!

Thanks,  
Keith G.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 28, 2020, 7:19pm UTC](https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138/2 "2020-09-28T19:19:46Z")

</div>

The FQDN is `java.net.http.HttpClient.Version`, so you’ll probably have to import some part of that.

Maybe `from java.net.http import HttpClient` and then you can use `HttpClient.Version.HTTP_1_1` in your script?

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [September 28, 2020, 7:28pm UTC](https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138/3 "2020-09-28T19:28:01Z")

</div>

> [@Kevin.Herron](#):
>
> Maybe `from java.net.http import HttpClient` and then you can use `HttpClient.Version.HTTP_1_1` in your script?

Looks like now its arguing that the HttpClientBuilderImpl class in [jdk.internal.net](http://jdk.internal.net) does not want to work with the java.net.http stuff, but honestly I have no idea what I am saying lol. Any ideas?

Here is my customizer:

```auto
def clientCustomizer(client):
	from java.net.http import HttpClient
	client.version(HttpClient.Version.HTTP_1_1)

```

Here is the error (happening on the last line of the customizer):

```auto
java.lang.IllegalAccessException: java.lang.IllegalAccessException: class org.python.core.PyReflectedFunction cannot access class jdk.internal.net.http.HttpClientBuilderImpl (in module java.net.http) because module java.net.http does not export jdk.internal.net.http to unnamed module @382ab8

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 28, 2020, 7:36pm UTC](https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138/4 "2020-09-28T19:36:48Z")

</div>

Hmm. This might no longer be something you’re doing wrong, but rather something we have to figure out and fix.

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [September 28, 2020, 7:38pm UTC](https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138/5 "2020-09-28T19:38:57Z")

</div>

> [@Kevin.Herron](#):
>
> This might no longer be something you’re doing wrong

Ugh, but its so much easier when I am the one thats wrong! lol

I appreciate the clarification though

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 28, 2020, 7:39pm UTC](https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138/6 "2020-09-28T19:39:36Z")

</div>

Easier for me too, haha.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 28, 2020, 8:07pm UTC](https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138/7 "2020-09-28T20:07:15Z")

</div>

For posterity: It’s a known bug that we’ll have to correct internally. Unfortunately, until it is, the `customizer` for `system.net.httpClient` just doesn’t work.

---

<div class="post-metadata">

**Author:** ![ryanjmclaughlin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryanjmclaughlin/32/4318_2.png) [@ryanjmclaughlin](https://forum.inductiveautomation.com/u/ryanjmclaughlin)\
**Post date:** [November 23, 2020, 8:36pm UTC](https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138/8 "2020-11-23T20:36:57Z")

</div>

Running into the below error intermittitently… google seems to indicate its common across the new HTTPClient. Was going to try to force HTTP1.1 ([https://stackoverflow.com/questions/59385349/java-11-httpclient-with-proxy-header-parser-received-no-bytes](https://stackoverflow.com/questions/59385349/java-11-httpclient-with-proxy-header-parser-received-no-bytes)) but…

```auto
Caused by: java.io.IOException: HTTP/1.1 header parser received no bytes

```

---

<div class="post-metadata">

**Author:** ![will\_d](https://avatars.discourse-cdn.com/v4/letter/w/3d9bf3/32.png) [@will\_d](https://forum.inductiveautomation.com/u/will_d)\
**Post date:** [January 18, 2021, 10:52pm UTC](https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138/9 "2021-01-18T22:52:31Z")

</div>

Any updates on this bug? It’s one I’m running into as well. Is this planned to be fixed in the 8.0.x branch, or only in 8.1.x?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [January 18, 2021, 11:00pm UTC](https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138/10 "2021-01-18T23:00:30Z")

</div>

We were just talking about this last week, it’s still an active bug. When it’s fixed it will only be fixed in 8.1.x.

---

<div class="post-metadata">

**Author:** ![will\_d](https://avatars.discourse-cdn.com/v4/letter/w/3d9bf3/32.png) [@will\_d](https://forum.inductiveautomation.com/u/will_d)\
**Post date:** [March 18, 2021, 3:28pm UTC](https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138/11 "2021-03-18T15:28:45Z")

</div>

I’ve been scanning through the nightly changelogs and haven’t seen anything specifically mentioning this one. Is this still an active bug at this time?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 18, 2021, 3:31pm UTC](https://forum.inductiveautomation.com/t/bug-16787-system-net-httpclient-httpclient-version-customizer/39138/12 "2021-03-18T15:31:51Z")

</div>

I believe it’s still active.

If I remember what @paul-griffith said there’s some tricky Java module system problem to solve that makes what seems like a trivial fix non-trivial for whatever reason.

I will add a note on the ticket that more people are running into this.
