Re: [go-nuts] Re: http.NewRequest stopped to check SSL certificate validity every time

2016-11-19 Thread James Bardin
On Sat, Nov 19, 2016 at 11:33 AM, Vasily Korytov 
wrote:

> It stays there for days, so I'm not sure. And the client is supposed to be
> created and destroyed in a function that terminates, so I'm really
> surprised by that.
>
>
The connection can stay there for as long as the server and client want it
to. SSL handshakes are expensive, and normally you try to avoid them when
possible.

The client doesn't maintain the connection, the Transport does, and you're
using the DefaultTransport. I'm not sure why http.Get would work
differently, since it's just calling DefaultClient.Get.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: http.NewRequest stopped to check SSL certificate validity every time

2016-11-19 Thread Vasily Korytov


On Saturday, November 19, 2016 at 6:21:49 PM UTC+2, James Bardin wrote:
>
>
> Chances are that you're getting better reuse of the client connections. If 
> you want to ensure that you reconnect periodically use Request.Close when 
> you don't want the connection maintained, or call 
> Transport.CloseIdleConnections occasionally between requests to force the 
> connections to close.
>

It stays there for days, so I'm not sure. And the client is supposed to be 
created and destroyed in a function that terminates, so I'm really 
surprised by that.

I've reverted http.Get instead of request.Do and now I get correct SSL 
checks.

Will check with Request.Close as well, thanks for the suggestion.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: http.NewRequest stopped to check SSL certificate validity every time

2016-11-19 Thread James Bardin

Chances are that you're getting better reuse of the client connections. If 
you want to ensure that you reconnect periodically use Request.Close when 
you don't want the connection maintained, or call 
Transport.CloseIdleConnections occasionally between requests to force the 
connections to close. 




On Saturday, November 19, 2016 at 9:07:58 AM UTC-5, Vasily Korytov wrote:
>
> P.S. I would like to line out things that changed since the SSL 
> certificate check was working:
>
> 1. Newer Go runtime
> 2. HTTP/2 connection
> 3. I used http.Get(url) before and now I use http.Client.Do (I use this 
> for customizing the User-Agent header)
>
> All the other things did not change, so the changed behaviour is a 
> surprise for me.
>
> Would appreciate any clues.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] Re: http.NewRequest stopped to check SSL certificate validity every time

2016-11-19 Thread Vasily Korytov
P.S. I would like to line out things that changed since the SSL certificate 
check was working:

1. Newer Go runtime
2. HTTP/2 connection
3. I used http.Get(url) before and now I use http.Client.Do (I use this for 
customizing the User-Agent header)

All the other things did not change, so the changed behaviour is a surprise 
for me.

Would appreciate any clues.

-- 
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.
For more options, visit https://groups.google.com/d/optout.