Disable HTTP2 example

2,132 views
Skip to first unread message

Gergely

unread,
Jun 18, 2020, 5:46:15 AM6/18/20
to Thorntail
How to disable HTTP2 by config?
Firefox cause at resources: WARNING [javax.enterprise.resource.webcontainer.jsf.application] (default task-5) : java.nio.channels.ClosedChannelException

Ladislav Thon

unread,
Jun 18, 2020, 5:53:18 AM6/18/20
to thor...@googlegroups.com

By default, we enable HTTP/2 automatically for HTTPS listeners, if I'm reading the code correctly.

You can disable it by setting `thorntail.undertow.servers.default-server.https-listeners.default-https.enable-http2` to `false`. (Or, if you're creating an HTTPS listener manually, use your own name.)

LT

--
You received this message because you are subscribed to the Google Groups "Thorntail" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thorntail+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/thorntail/021d3eb9-d7ca-4826-8d8a-eac33ed7004co%40googlegroups.com.

Gergely

unread,
Jun 18, 2020, 5:54:15 AM6/18/20
to Thorntail
*Hi

Not work well (just try ssl):

  https:
    certificate:
      generate: true
    port: 8443
  undertow:
    servers:
      default:
        https-listeners:
          default-https:
            enable-http2: false # currently firefox not working well with it
            socket-binding: https

Ladislav Thon

unread,
Jun 18, 2020, 5:56:16 AM6/18/20
to thor...@googlegroups.com
On 18. 06. 20 11:50, Gergely wrote:
*Hi

Not work well (just try ssl):

  https:
    certificate:
      generate: true
    port: 8443
  undertow:
    servers:
      default:

I think the default server is called `default-server`. Unfortunately the default names are not terribly easy to find, not sure how to improve that :-(

LT

        https-listeners:
          default-https:
            enable-http2: false # currently firefox not working well with it
            socket-binding: https

2020. június 18., csütörtök 11:46:15 UTC+2 időpontban Gergely a következőt írta:
How to disable HTTP2 by config?
Firefox cause at resources: WARNING [javax.enterprise.resource.webcontainer.jsf.application] (default task-5) : java.nio.channels.ClosedChannelException
--
You received this message because you are subscribed to the Google Groups "Thorntail" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thorntail+...@googlegroups.com.

Gergely

unread,
Jun 18, 2020, 6:06:53 AM6/18/20
to Thorntail
From documentation:
Configuration of items with the KEY parameter

A configuration item documented as thorntail.undertow.servers.KEY.default-host indicates that the configuration applies to a particular named server.

In practical usage, the property would be, for example, thorntail.undertow.servers.default.default-host for a server known as default.


`thorntail.undertow.servers.

default-server.https-listeners.default-https.enable-http2` to `false`

Result:
ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 5) WFLYCTL0013: Operation ("add") failed - address: ([
    ("subsystem" => "undertow"),
    ("server" => "default-server"),
    ("https-listener" => "default-https")
]) - failure description: "WFLYCTL0155: 'socket-binding' may not be null"

with socket-binding: https
Result:
ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("internal-model-validation") failed - address: ([]) - failure description: "WFLYCTL0446: ssl-context or alternative(s) [security-realm] is required"

2020. június 18., csütörtök 11:56:16 UTC+2 időpontban Ladislav Thon a következőt írta:
On 18. 06. 20 11:50, Gergely wrote:
*Hi

Not work well (just try ssl):

  https:
    certificate:
      generate: true
    port: 8443
  undertow:
    servers:
      default:

I think the default server is called `default-server`. Unfortunately the default names are not terribly easy to find, not sure how to improve that :-(

LT

        https-listeners:
          default-https:
            enable-http2: false # currently firefox not working well with it
            socket-binding: https

2020. június 18., csütörtök 11:46:15 UTC+2 időpontban Gergely a következőt írta:
How to disable HTTP2 by config?
Firefox cause at resources: WARNING [javax.enterprise.resource.webcontainer.jsf.application] (default task-5) : java.nio.channels.ClosedChannelException
--
You received this message because you are subscribed to the Google Groups "Thorntail" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thor...@googlegroups.com.

Gergely

unread,
Jun 18, 2020, 6:40:22 AM6/18/20
to Thorntail
Not so easy to disable HTTP2, the config require almost all sub config, and hard to find default configs for re-set.

Ladislav Thon

unread,
Jun 18, 2020, 6:42:39 AM6/18/20
to thor...@googlegroups.com

Hi,

so, yea, you're right, the default names are hard to find (easiest is to add the `management` fraction, which you need for HTTPS anyway, and connect to the running server via WildFly CLI). But that's not the biggest problem.

It seems the configuration is read before the HTTP/2 support is automatically configured, and while there's some support for re-reading the configuration after all such customizations are performed, for some reason it is skipped in this case.

I'm afraid there's no easy way to disable HTTP/2 right now.

LT

To unsubscribe from this group and stop receiving emails from it, send an email to thorntail+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/thorntail/e976775b-c8d2-4863-9dca-4f469e3ccf27o%40googlegroups.com.

Gergely

unread,
Jun 18, 2020, 6:45:23 AM6/18/20
to Thorntail
  https:
    certificate:
      generate: true
    port: 8443
  undertow:
    servers:
      default-server:

        https-listeners:
          default-https:
            enable-http2: false # currently firefox not working well with it
            socket-binding: https
            security-realm: SSLRealm

Gergely

unread,
Jun 18, 2020, 7:00:42 AM6/18/20
to Thorntail
It is possible to create two or more port for different https settings?

Ladislav Thon

unread,
Jun 18, 2020, 7:09:11 AM6/18/20
to thor...@googlegroups.com

That is possible, but won't help, as the HTTP2Customizer modifies all HTTPS listeners on all Undertow servers.

I'm sorry, but you just ran into a pretty serious bug in Thorntail's configuration system.

LT

To unsubscribe from this group and stop receiving emails from it, send an email to thorntail+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/thorntail/f39b541c-1429-4fff-9f54-f50ecbb16f88o%40googlegroups.com.

Ladislav Thon

unread,
Jun 18, 2020, 7:59:51 AM6/18/20
to thor...@googlegroups.com

Just a few more things.

A very crude workaround is possible: when you build your uberjar (say myapp-thorntail.jar), you can enter it, go to m2repo/io/thorntail/undertow/2.7.0.Final/, enter the undertow-2.7.0.Final.jar archive, go to org/wildfly/swarm/undertow/runtime and delete the HTTP2Customizer.class file. That will make sure automatic enablement of HTTP/2 is gone for good. As I said, very crude, but effective :-) I'll submit a PR later today to allow ignoring customizers via configuration -- not a real solution, but at least a reasonable workaround.

Also, it seems to me that you're just starting a new project with Thorntail -- if that's the case, I'd recommend you look into migrating it to WildFly or Quarkus before it becomes too big. Thorntail is near the end of its lifecycle.

LT

Gergely

unread,
Jun 18, 2020, 9:00:57 AM6/18/20
to Thorntail
Red Hat build of Quarkus 1.x end: Oct 2020

What is WildFly plan?
--
You received this message because you are subscribed to the Google Groups "Thorntail" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thor...@googlegroups.com.

Ladislav Thon

unread,
Jun 18, 2020, 9:11:40 AM6/18/20
to thor...@googlegroups.com

I'm talking about community projects here.

What you're linking only applies to Red Hat products. (The Red Hat product based on Quarkus is called "Red Hat build of Quarkus", while the Red Hat product based on WildFly is called "Red Hat JBoss Enterprise Application Platform".)

LT

To unsubscribe from this group and stop receiving emails from it, send an email to thorntail+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/thorntail/ea830a22-74ee-4ac3-b1a5-131885d4d793o%40googlegroups.com.

Ladislav Thon

unread,
Jun 19, 2020, 6:02:43 AM6/19/20
to thor...@googlegroups.com
On 18. 06. 20 13:59, Ladislav Thon wrote:

Just a few more things.

A very crude workaround is possible: when you build your uberjar (say myapp-thorntail.jar), you can enter it, go to m2repo/io/thorntail/undertow/2.7.0.Final/, enter the undertow-2.7.0.Final.jar archive, go to org/wildfly/swarm/undertow/runtime and delete the HTTP2Customizer.class file. That will make sure automatic enablement of HTTP/2 is gone for good. As I said, very crude, but effective :-) I'll submit a PR later today to allow ignoring customizers via configuration -- not a real solution, but at least a reasonable workaround.

I've filed an issue for that: https://issues.redhat.com/browse/THORN-2576 and submitted a PR.

LT

Reply all
Reply to author
Forward
0 new messages