I'm having login problems since 4(?) days, forcing curl to use http1.1 solves this problem.
This is verbose output of curl when using http2:
{ [5 bytes data]
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
} [5 bytes data]
* We are completely uploaded and fine
{ [5 bytes data]
* HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
* Curl_http_done: called premature == 1
* Closing connection 0
In my view this is related to the submitted Referer. But don't know how to fix this at the moment.