Skip to content
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

Disabling HTTP2 Upgrade #246

Closed
hsfougaris opened this issue Jul 7, 2021 · 5 comments
Closed

Disabling HTTP2 Upgrade #246

hsfougaris opened this issue Jul 7, 2021 · 5 comments

Comments

@hsfougaris
Copy link

I upgraded a project that was using the previous version with Qt5, as I am trying to convert my project to Qt6.
So now with KDSOAP 2, I have a problem with the target server, as I see in the header the introduction of the HTTP2 upgrade tag.
Is there a way to disable sending the upgrade offer tag? I think the server is supposed to ignore it, but it doesn't and logs it as an invalid tag (forbidden protocol upgrade to h2c).
I cannot really change the server, so is it something we can control in the library ?
Is it maybe a Qt6 thing ?
thank you

@dfaure-kdab
Copy link
Member

It is for sure a Qt6 thing, nothing else changed in KDSoap, and this is handled by QNetworkAccessManager.
The next step is to look at QNetworkAccessManager docs to see which control it offers over that kind of thing, and then we can add similar methods to KDSoapClientInterface.

@hsfougaris
Copy link
Author

Thank you for the quick reply.
It seems you are right, https://www.qt.io/blog/qt-network-in-qt-6
"In Qt 6, HTTP/2 support is enabled by default: this means the attribute 'Http2AllowedAttribute' is set to true"

@dfaure-kdab
Copy link
Member

I wonder if KDSoap shouldn't just set it to false unconditionally... I just did some googling around about SOAP and HTTP/2, and it doesn't seem to be a common combination at all. In fact the HTTP/2 FAQ says they are mostly targeting the browser use case, not APIs over HTTP. Although I guess the binary protocol would be good for performance. But whether any SOAP servers support HTTP/2 is another story...

Let's just disable it for now and see if anyone requests it ;)

@hsfougaris
Copy link
Author

That's kind of what I did temporarily.
In KDSoapClientInterface.cpp, after line 91
QNetworkRequest request(QUrl(this->m_endPoint));
I added:
request.setAttribute(QNetworkRequest::Http2AllowedAttribute, false);

Seems to work like a charm!

Thank you

@dfaure-kdab
Copy link
Member

Great, that's also what I just did ;)
Thanks for the testing, pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants