1

I've blocked the http protocol(enabled https only) in wildfly 9.0 by changing below configuration

Changed connector-ref="default" to connector-ref="default-ssl"

<subsystem xmlns="urn:jboss:domain:remoting:3.0">
  <endpoint worker="default"/>
  <http-connector name="http-remoting-connector" connector-ref="default-ssl" security-realm="ApplicationRealm"/>
</subsystem>

Commented the http-listener

<subsystem xmlns="urn:jboss:domain:undertow:2.0">
            <buffer-cache name="default"/>
            <server name="default-server">
               <!-- <http-listener name="default" socket-binding="http" redirect-socket="https"/> -->
                <https-listener name="def.....

it worked..i am able to block the http and enabled https protocol access only. Ideally it should reject the http request. But, now problem is, whenever i am accessing the http://localhost:8080/MyWebApp/ , its rejecting the http request, but at the same time, web page is downloading a blank download file. why ???

Thanks.

ManishS
  • 627
  • 2
  • 11
  • 21
  • whenever you access http ://yoursite, or when you access http**s**://yoursite? – Gimby Jun 15 '16 at 08:19
  • Just making sure there was no typo. How exactly do you know the HTTP request is rejected? – Gimby Jun 15 '16 at 10:09
  • commenting http-listener under subsystem xmlns="urn:jboss:domain:undertow:2.0" will not listen to http requests..right – ManishS Jun 15 '16 at 11:14

1 Answers1

0

You should redirect your http requests to https instead of disabling the http:

 <connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http" redirect-port="443" />

Add a redirect handler in the handlers part, something along the way of:

<host name="other-host" alias="www.mysite.com, ${prop.value:default-alias}" default-web-module="something.war" disable-console-redirect="true">
        <location name="/" handler="welcome-content">
            <filter-ref name="redirects" predicate="!secure" />
        </location>
        <filter-ref name="headers"/>
    </host>
</server>

... https://myserver/'" redirect="true" />

ehsavoie
  • 3,126
  • 1
  • 16
  • 14