'Determine if HTTPS redirect is valid when protocol is HTTP'

def _valid_HTTPS_redirect_with_HTTP_prot(self):

    proto = self.properties[self.PROTOCOL]
    redir = self.properties[self.HTTPS_REDIRECT]
    termcfg = (self.properties.get(self.SSL_TERMINATION) or {})
    seconly = termcfg.get(self.SSL_TERMINATION_SECURE_TRAFFIC_ONLY, False)
    secport = termcfg.get(self.SSL_TERMINATION_SECURE_PORT, 0)
    if (redir and (proto == 'HTTP') and seconly and (secport == 443)):
        return True
    return False
