When you setup slave with slave-agent.jnlp it tries to connect to /tcpSlaveAgentListener/ and get JNLP port. I'm not sure if this code is relevant but the check seem to be working like this:
However according to RFC 7230 and RFC 7540 HTTP headers are case-insensitive.
The problem is that if you use proxy written in go agent won't connect with an "java.io.IOException: https://myjenkins.net/ is not Jenkins" error.
See https://github.com/golang/go/issues/21868 for more details.