New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base64 vs. Base64Url #62

Closed
oleksiys opened this Issue Jul 25, 2014 · 3 comments

Comments

Projects
None yet
3 participants
@oleksiys

oleksiys commented Jul 25, 2014

Hi,
not sure if it's curl or nghttp2 problem.
The HTTP/2.0 request sent by curl looks like:
HttpRequestPacket (
method=GET
url=/download/1
query=null
protocol=HTTP/1.1
content-length=-1
headers=[
user-agent=curl/7.38.0-DEV
host=localhost:7070
accept=/
connection=Upgrade, HTTP2-Settings
upgrade=h2c-13
http2-settings=AAMAAABkAAQAAP//]
)

as we see the HTTP2-Settings value is "AAMAAABkAAQAAP//", where according to the HTTP/2.0 draft 13:
"The content of the "HTTP2-Settings" header field is the payload of a
SETTINGS frame (Section 6.5), encoded as a base64url string (that is,
the URL- and filename-safe Base64 encoding described in Section 5 of
[RFC4648]"

in section 5 of [RFC4648] there is no slash symbol in the Base64Url table, this symbol only exists in Base64 table, but as I mentioned HTTP/2.0 has to use Base64Url.

Thank you!

@bagder

This comment has been minimized.

Contributor

bagder commented Jul 25, 2014

Oh, nice catch. That's libcurl's Curl_http2_request_upgrade() function doing the base64 encoding. I suppose I didn't pay enough attention on the details...

bagder added a commit to curl/curl that referenced this issue Jul 25, 2014

base64: added Curl_base64url_encode()
This is now used by the http2 code. It has two different symbols at the
end of the base64 table to make the output "url safe".

Bug: nghttp2/nghttp2#62
@bagder

This comment has been minimized.

Contributor

bagder commented Jul 25, 2014

Fixed in this commit in curl: curl/curl@aae4e4b

@tatsuhiro-t

This comment has been minimized.

Collaborator

tatsuhiro-t commented Jul 25, 2014

Alright, close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment