Check for and report bad protocol in TLSClientConfig.NextProtos#788
Check for and report bad protocol in TLSClientConfig.NextProtos#78810 commits merged intogorilla:masterfrom
Conversation
amustaque97
left a comment
There was a problem hiding this comment.
@ChannyClaus thank you for taking this forward. Changes look good to me.
cc @garyburd
|
client_server_http2_test.go
Outdated
| // license that can be found in the LICENSE file. | ||
|
|
||
| //go:build go1.14 | ||
| // +build go1.14 |
There was a problem hiding this comment.
this was necessary because https://github.com/gorilla/websocket/pull/788/files#diff-647b905ba2feaa4a134811cd904e1fd3af5d28129e9b9031cfa4fc127f5c55fdR20 was not present prior to go version 1.14
|
thanks for the quick turnaround @amustaque97 @easterf - made the suggested changes, let me know if there's anything else! |
|
@garyburd done! can also move the check into a separate function if need be (the indenting gets a little crazy now) |
|
seems like using |
|
I’m checking on Circle CI from past few days because of some issues I’m facing in other project gorilla mux. CI doesn’t trigger all the time if we create branch n PR at the same time. Here is the link of same issue mentioned by Circle CI https://support.circleci.com/hc/en-us/articles/360008097173-Why-aren-t-pull-requests-triggering-jobs-on-my-organization- If we all agree we can move from circle ci to GitHub actions else I can raise a PR to remove golang versions in circle ci. Let me know what do you think? |
…tocol that is not http/1.1
…onditionally on go versions >= 1.14
… reduce the possibility of false positives
…of go" This reverts commit d34dd94.
…d constraint is no longer necessary
|
[](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/gorilla/websocket](https://togithub.com/gorilla/websocket) | require | patch | `v1.5.0` -> `v1.5.1` | --- ### Release Notes <details> <summary>gorilla/websocket (github.com/gorilla/websocket)</summary> ### [`v1.5.1`](https://togithub.com/gorilla/websocket/releases/tag/v1.5.1) [Compare Source](https://togithub.com/gorilla/websocket/compare/v1.5.0...v1.5.1) #### What's Changed - Add check for Sec-WebSocket-Key header by [@​hirasawayuki](https://togithub.com/hirasawayuki) in [https://github.com/gorilla/websocket/pull/752](https://togithub.com/gorilla/websocket/pull/752) - Changed the method name UnderlyingConn to NetConn by [@​JWSong](https://togithub.com/JWSong) in [https://github.com/gorilla/websocket/pull/773](https://togithub.com/gorilla/websocket/pull/773) - remove all versions < 1.16 and add 1.18 by [@​ChannyClaus](https://togithub.com/ChannyClaus) in [https://github.com/gorilla/websocket/pull/793](https://togithub.com/gorilla/websocket/pull/793) - Check for and report bad protocol in TLSClientConfig.NextProtos by [@​ChannyClaus](https://togithub.com/ChannyClaus) in [https://github.com/gorilla/websocket/pull/788](https://togithub.com/gorilla/websocket/pull/788) - check err before GotConn for trace by [@​junnplus](https://togithub.com/junnplus) in [https://github.com/gorilla/websocket/pull/798](https://togithub.com/gorilla/websocket/pull/798) - Update README.md by [@​coreydaley](https://togithub.com/coreydaley) in [https://github.com/gorilla/websocket/pull/839](https://togithub.com/gorilla/websocket/pull/839) - Correct way to save memory using write buffer pool and freeing net.http default buffers by [@​FMLS](https://togithub.com/FMLS) in [https://github.com/gorilla/websocket/pull/761](https://togithub.com/gorilla/websocket/pull/761) - Update go version & add verification/testing tools by [@​coreydaley](https://togithub.com/coreydaley) in [https://github.com/gorilla/websocket/pull/840](https://togithub.com/gorilla/websocket/pull/840) - update golang.org/x/net by [@​coreydaley](https://togithub.com/coreydaley) in [https://github.com/gorilla/websocket/pull/856](https://togithub.com/gorilla/websocket/pull/856) - update GitHub workflows by [@​coreydaley](https://togithub.com/coreydaley) in [https://github.com/gorilla/websocket/pull/857](https://togithub.com/gorilla/websocket/pull/857) #### New Contributors - [@​hirasawayuki](https://togithub.com/hirasawayuki) made their first contribution in [https://github.com/gorilla/websocket/pull/752](https://togithub.com/gorilla/websocket/pull/752) - [@​JWSong](https://togithub.com/JWSong) made their first contribution in [https://github.com/gorilla/websocket/pull/773](https://togithub.com/gorilla/websocket/pull/773) - [@​ChannyClaus](https://togithub.com/ChannyClaus) made their first contribution in [https://github.com/gorilla/websocket/pull/793](https://togithub.com/gorilla/websocket/pull/793) - [@​junnplus](https://togithub.com/junnplus) made their first contribution in [https://github.com/gorilla/websocket/pull/798](https://togithub.com/gorilla/websocket/pull/798) - [@​coreydaley](https://togithub.com/coreydaley) made their first contribution in [https://github.com/gorilla/websocket/pull/839](https://togithub.com/gorilla/websocket/pull/839) - [@​FMLS](https://togithub.com/FMLS) made their first contribution in [https://github.com/gorilla/websocket/pull/761](https://togithub.com/gorilla/websocket/pull/761) **Full Changelog**: gorilla/websocket@v1.5.0...v1.5.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 6am on Monday" in timezone Europe/Paris, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/cozy/cozy-stack). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMS41IiwidXBkYXRlZEluVmVyIjoiMzcuMzEuNSIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->
This MR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/gorilla/websocket](https://github.com/gorilla/websocket) | require | patch | `v1.5.0` -> `v1.5.1` | --- ### Release Notes <details> <summary>gorilla/websocket (github.com/gorilla/websocket)</summary> ### [`v1.5.1`](https://github.com/gorilla/websocket/releases/tag/v1.5.1) [Compare Source](gorilla/websocket@v1.5.0...v1.5.1) #### What's Changed - Add check for Sec-WebSocket-Key header by [@​hirasawayuki](https://github.com/hirasawayuki) in gorilla/websocket#752 - Changed the method name UnderlyingConn to NetConn by [@​JWSong](https://github.com/JWSong) in gorilla/websocket#773 - remove all versions < 1.16 and add 1.18 by [@​ChannyClaus](https://github.com/ChannyClaus) in gorilla/websocket#793 - Check for and report bad protocol in TLSClientConfig.NextProtos by [@​ChannyClaus](https://github.com/ChannyClaus) in gorilla/websocket#788 - check err before GotConn for trace by [@​junnplus](https://github.com/junnplus) in gorilla/websocket#798 - Update README.md by [@​coreydaley](https://github.com/coreydaley) in gorilla/websocket#839 - Correct way to save memory using write buffer pool and freeing net.http default buffers by [@​FMLS](https://github.com/FMLS) in gorilla/websocket#761 - Update go version & add verification/testing tools by [@​coreydaley](https://github.com/coreydaley) in gorilla/websocket#840 - update golang.org/x/net by [@​coreydaley](https://github.com/coreydaley) in gorilla/websocket#856 - update GitHub workflows by [@​coreydaley](https://github.com/coreydaley) in gorilla/websocket#857 #### New Contributors - [@​hirasawayuki](https://github.com/hirasawayuki) made their first contribution in gorilla/websocket#752 - [@​JWSong](https://github.com/JWSong) made their first contribution in gorilla/websocket#773 - [@​ChannyClaus](https://github.com/ChannyClaus) made their first contribution in gorilla/websocket#793 - [@​junnplus](https://github.com/junnplus) made their first contribution in gorilla/websocket#798 - [@​coreydaley](https://github.com/coreydaley) made their first contribution in gorilla/websocket#839 - [@​FMLS](https://github.com/FMLS) made their first contribution in gorilla/websocket#761 **Full Changelog**: gorilla/websocket@v1.5.0...v1.5.1 </details> --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yODYuMSIsInVwZGF0ZWRJblZlciI6IjM3LjI4Ni4xIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=--> See merge request alpine/infra/build-server-status!9
Fixes #760
Summary of Changes
websocket/client.go
Line 191 in 78cf1bc
did run the unit test included in the issue and got
which is expected; can add this or some other form of unit test to assert on the error message if desired (seemed somewhat unnatural to assert on the error message, hence the omission)