Adds the possibility to change the USE_TLS_RESPONSE HTTP response#709
Adds the possibility to change the USE_TLS_RESPONSE HTTP response#709Leon-Schwandt wants to merge 2 commits intoapache:mainfrom
Conversation
|
I would like to see this feature added to Tomcat. Does anyone know the reason why it has not been merged, yet? Some background on my use case: When I have a secure (https) connector listening on some port (say 8080) and I accidentally call it without TLS (e.g., http://localhost:8080/ instead of https://localhost:8080/), I get an error response as follows: For non-technical users, this error response is not ideal. Therefore, I would like to be able to configure this response. Ideally in my case, the response would be a redirect that changes the protocol from http to https and leaves the remaining url the same. But serving a custom static HTML response would be sufficient, too (as I could then, e.g., implement the redirect in JavaScript or provide a user-friendly explanation). Also, in my case, configuration via code would be sufficient as I run Tomcat embedded as a library. |
|
This is my first pull request in a public repository, so I don’t have much experience with this yet. Since I didn’t receive any response to my pull request for months, I didn’t follow up on it. That’s why I didn’t notice the merge conflict. I’d also be interested to know why my PR hasn’t been merged yet; exactly what @tobiasbaum described was also my thought, which is why I created the PR two years ago. |
Enables the USE_TLS_RESPONSE message to be changed at a global level. A possible use case would be a redirect to HTTPS
|
I've rebased the PR onto the current main branch and resolved all merge conflicts (including removing changes to SecureNio2Channel.java since NIO2 was dropped in Tomcat 12). |
|
This seems to have no practical use as is. There needs to be another mechanism to implement this otherwise it's clearly not an option. |
Enables the USE_TLS_RESPONSE message to be changed at a global level. A possible use case would be a redirect to HTTPS