Hi Eli,

thank you very much! A day later I suspected something wrong with the cert 
assignment but what got me was the order of assignment of the 
transport.TLSClientConfig. Thank you so much for your example! The TLS 
config obviously has to be assigned before Configuring (transport and 
promoting the transport to an http2 transport).
This is really unfortunate that it is a connection pool error and no cert 
error.

Thanks for your answer again Eli, have a merry Xmas.

Best regards
Nik 

On Tuesday 12 December 2023 at 17:21:38 UTC+1 Eli Lindsey wrote:

> The http2 client relies on the http/1.1 client doing the dial and uses its 
> established connections - this error shows up when the http/1.1 client has 
> no pooled TLS connections for the http2 client to use.
>
> The issue is that the httptest server is using a self-signed certificate, 
> the client hasn’t been configured to trust it, thus it’s unable to create 
> any valid TLS connections for the http2 client to use. It seems unfortunate 
> that it’s returning a pool error and not “certificate signed by unknown 
> authority”, which would’ve been more clear.
>
> https://gist.github.com/elindsey/0a98a3784fb059fd4458afe70b7737ee is an 
> example of how to trust the cert from httptest.Server and passes locally 
> for me.
>
> -eli
>
> On Dec 12, 2023, at 9:12 AM, Nik Steffen <dominik...@gmail.com> wrote:
>
> Hi fellow gophers,
>
> I already asked my Question on r/golang but could not get an answer 
> despite >2500 views. So i wanted it to try here as i imagine people are a 
> little more in the hard stuff.
>
> Currently I am struggling with a problem regarding an http2 client playing 
> around with an issue in our system where http2 could help solving the 
> problem. For this I created the following test gist. I did this after 
> facing the same problem I am describing in this post in a test 
> implementation in our real test system. So I wanted to isolate the test 
> case.
>
> https://gist.github.com/niksteff/7d39c6f674a7bf98d71ad2c3add68f94
>
> In this gist I am running an http1.1 and http2 server and sending the a 
> request to both - each from it's corresponding client. *Go Version* is 
> *1.21.4* for the example.
>
> Currently the http2 client does not reach the server as the following 
> error occurs:
> http2: no cached connection was available 
>
> I'm all out of ideas what is missing but i suspect something in the http2 
> client configuration?
>
> Anybody able to help? What am I missing while configuring the client?
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/08f74129-a14f-418a-a87f-fd6e47d095ccn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/golang-nuts/08f74129-a14f-418a-a87f-fd6e47d095ccn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f4994df2-568b-47a7-8dd4-6c764b63c9f2n%40googlegroups.com.

Reply via email to