Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

propertyTsmCustomHTTPSProtocol.PlainTextResources

property PlainTextResources: tPlainTextRules read fPlainTextResources write fPlainTextResources;
Where a plaintext request accepted on the server's PlainTextRedirectPort is turned into a redirect. Handling it is the whole reason that port exists.

aHost and aTarget are what the peer asked for - the Host header and the request target - and are UNTRUSTED. aLocation arrives holding the default answer, 'https://' + aHost + aTarget, and aStatusCode holds 301; a handler that does nothing therefore still redirects correctly. Change either to redirect somewhere else, to a canonical host, or to answer 308 instead.

SETTING aLocation TO '' REFUSES: the connection is closed with no response at all, which is the right answer for a Host this deployment does not serve. Prefer that to redirecting a name you do not recognise - echoing an arbitrary Host into a Location header is an open redirect, and the default above does exactly that for any name that reaches the port, which is safe only because it cannot leave the scheme.

Runs on a short-lived thread of its own, not an I/O thread, and the socket is closed the moment it returns. THE COMPLETE SET OF THINGS THIS SERVER WILL EMIT WITHOUT TLS. nil, the default, means the plaintext listener does nothing but redirect - what it has always done, and what most deployments want.

Assign a tPlainTextRules and the resources it names become fetchable over http, on the plaintext listener only. Nothing here reaches the HTTP engine, the router, the limits or a session: it is answered on the same one-shot, no-keep-alive, deadline-bounded path as a redirect, because it is the same KIND of thing - a short answer to an unauthenticated peer.

The server does not own it. A deployment creates one, fills it in beside where it sets PlainTextRedirectPort, and frees it after. That keeps the whole cleartext surface visible at one call site.