Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Calculate OktaClient Content-Length correctly #300

Merged

Conversation

Chippiewill
Copy link
Contributor

Previously the content length was being calculated based off of an empty
uninitialised byte array. With this change it's now calculated off of the
actual data array used as the body.

Setting the content length to 0 seemed to be causing an issue with
recent changes to Okta's infrastructure as noticed in #298.

Previously the content length was being calculated based off of an empty
uninitialised byte array. With this change it's now calculated off of the
actual data array used as the body.

Setting the content length to 0 seemed to be causing an issue with
recent changes to Okta's infrastructure as noticed in segmentio#298.
@Chippiewill Chippiewill changed the title Calculate OktaClient Content-Length correctly Fixes #298 - Calculate OktaClient Content-Length correctly Sep 30, 2020
@nickatsegment
Copy link
Contributor

Does this fix #298 even without #299 ?

@nickatsegment
Copy link
Contributor

@sdann Can you verify that this fixes #298 independent of #299?

@Chippiewill
Copy link
Contributor Author

Chippiewill commented Sep 30, 2020

Yes it does, I came up with this fix before seeing #299

@sdann
Copy link
Contributor

sdann commented Sep 30, 2020

Wow, such a simple mistake. @nickatsegment confirmed, just this patch, without #298 fixes the issue in our environment.
h2 is still negotiated by TLS.

I'm guessing the HTTP1 server implementation handles the 0 Content-Length, while the HTTP2 implementation is stricter, and won't read any more of the POST packet because we said it was 0.

@sdann
Copy link
Contributor

sdann commented Sep 30, 2020

We may also want to be explicit on the NextProto, but I'd love to get just this fix into an official 1.0.5 version to unblock my users ASAP.

@nickatsegment
Copy link
Contributor

@sdann awesome. Will get it merged ASAP

@nickatsegment nickatsegment changed the title Fixes #298 - Calculate OktaClient Content-Length correctly Calculate OktaClient Content-Length correctly Sep 30, 2020
@nickatsegment nickatsegment merged commit dbe3493 into segmentio:master Sep 30, 2020
arohter pushed a commit to TiVo/aws-okta that referenced this pull request Nov 21, 2020
arohter added a commit to TiVo/aws-okta that referenced this pull request Nov 21, 2020
arohter added a commit to TiVo/aws-okta that referenced this pull request Nov 21, 2020
* Revert "disable github releases (currently broken) (segmentio#305)"

This reverts commit b5cad3b.

* Revert "Added Ubuntu 2020 (Focal) to Makefile.release (segmentio#304)"

This reverts commit ac21803.

* Revert "Fix cred process expiration (segmentio#303)"

This reverts commit 90c0192.

* Revert "Update issue templates"

This reverts commit 9e17974.

* Revert "Calculate OktaClient Content-Length correctly (segmentio#300)"

This reverts commit e93f247.
arohter added a commit to TiVo/aws-okta that referenced this pull request Nov 21, 2020
* Calculate OktaClient Content-Length correctly (segmentio#300)

Fixes: segmentio#298

* Update issue templates

* Fix cred process expiration (segmentio#303)

* Added Ubuntu 2020 (Focal) to Makefile.release (segmentio#304)

* disable github releases (currently broken) (segmentio#305)

Co-authored-by: Will Gardner <[email protected]>
Co-authored-by: Nick Irvine <[email protected]>
Co-authored-by: Zoltán Reegn <[email protected]>
Co-authored-by: Yossi Eliaz <[email protected]>
@nickatsegment
Copy link
Contributor

Had a few Segmenters mention that they required this fix after coming back from vacation today, and that they were using v1.0.4 successfully up until then. Strange.

@Chippiewill Chippiewill deleted the calculate-content-length-correctly branch January 5, 2021 14:15
arohter added a commit to TiVo/aws-okta that referenced this pull request Feb 19, 2021
* Calculate OktaClient Content-Length correctly (segmentio#300)

Fixes: segmentio#298

* Update issue templates

* Fix cred process expiration (segmentio#303)

* Added Ubuntu 2020 (Focal) to Makefile.release (segmentio#304)

* disable github releases (currently broken) (segmentio#305)

* Update AWS Go SDK To v1.25.35 (segmentio#307)

Fixes STS regional endpoint support.

* Add STS Regional Endpoint Support To Other STS Clients (segmentio#308)

* Update keyring to v1.1.6 (segmentio#309)

Recent versions of kwallet have removed the old support for the kde4
compatible kwallet dbus interface. This means newer kde5 based
OS installs (e.g. kubuntu 20.04) can no longer use the kwallet backend
with aws-okta.

This was fixed upstream in the keyring lib back in 2019 but the
dependency hasn't been bumped since then.

Co-authored-by: Will Gardner <[email protected]>
Co-authored-by: Nick Irvine <[email protected]>
Co-authored-by: Zoltán Reegn <[email protected]>
Co-authored-by: Yossi Eliaz <[email protected]>
Co-authored-by: Andrew Babichev <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants