You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception in thread "main" java.lang.ExceptionInInitializerError
at clojure.main.<clinit>(main.java:20)
Caused by: java.lang.ClassNotFoundException: clojure.edn, compiling:(cognitect/aws/service.clj:25:3)
It appears that there are a fewplaces that use clojure.edn without requiring it. This works most of the time, but not if you have requires (or transient requires) in your user ns.
The text was updated successfully, but these errors were encountered:
Problem:
We can't control some HTTP headers (or pseudo-headers in HTTP/2) directly, like `Host` (in HTTP/1.1) or `:authority` (in HTTP/2), because these headers are managed by JDK's HttpClient. However, the value of these headers must be predictable, because they affect the output of AWS4-HMAC-SHA256 (i.e. `Host` is a signed header).
HTTP/2 requires the `:authority` pseudo-header to be present, and its value is used by AWS to verify the signature (instead of the `Host` header from HTTP/1.1).
There is a small difference in behavior in JDK's HttpClient when issuing an HTTP/1.1 vs an HTTP/2 request:
- for HTTP/1.1 requests, the `Host` header is derived from an InetSocketAddress and is never included if it matches the default port for the protocol [1]
- for HTTP/2 requests, the `:authority` header is derived from a URI, and it's always included if it was explicitly set (even if the explicitly set value matches the default port for the protocol) [2]
We explicitly set the port for all requests to 443, and this small difference between HTTP/1.1 and HTTP/2 clients causes invalid signatures on HTTP/2 services [3].
Solution:
Do not include the default port in the URI generated when using JDK's HttpClient. This generates the correct signature in HTTP/1.1 (using `Host`) and in HTTP/2 (using `:authority`) requests.
[1] https://github.com/openjdk/jdk/blob/890adb6410dab4606a4f26a942aed02fb2f55387/src/java.net.http/share/classes/jdk/internal/net/http/Http1Request.java#L237-L241
[2] https://github.com/openjdk/jdk/blob/890adb6410dab4606a4f26a942aed02fb2f55387/src/java.net.http/share/classes/jdk/internal/net/http/Stream.java#L818-L822
[3] #261
If you have a
deps.edn
:and a
src/user.clj
:The following command:
Fails with
It appears that there are a few places that use
clojure.edn
without requiring it. This works most of the time, but not if you have requires (or transient requires) in your user ns.The text was updated successfully, but these errors were encountered: