I finally found a solution, and it's really, really easy. Just add the flag -Dcom.sun.webkit.useHTTP2Loader=false. Thanks to this comment.
-Dcom.sun.webkit.useHTTP2Loader=false