How can I configure ufw so that it blocks any connection to port 443 using the http protocol, but not the https protocol. So what I mean is:
http://example.com:443 (Deny any connection) https://example.com:443 (Allow any connection)
Can anyone please help me on this? Thanks in advance!
Edit:
If there is any other program for doing this, please let me know! Thanks!
This just an opinion until you get another valid answer.
is the typical command for
ufw
butgives
And
Now my guess is that
ufw
only works on the Transport layer. In that layer you can access port numbers, transport layer protocols like TCP/UDP, and of course the IP addresses. Andufw
is capable of working with those. But http/https is on session layer, one layer lower than transport layer andufw
does not have access to those. But there are other firewalls that work on different layer according to thisHTTP uses Port 80, HTTPS is using Port 443. Therefore, you can't block HTTP by filtering Port 443/TCP.