protected function _secureRequired(Controller $controller)
    {
        if (is_array($this->_config['requireSecure']) &&
            !empty($this->_config['requireSecure'])
        ) {
            $requireSecure = $this->_config['requireSecure'];

            if (in_array($this->_action, $requireSecure) || $requireSecure === ['*']) {
                if (!$this->getController()->getRequest()->is('ssl')) {
                    throw new SecurityException(
                        'Request is not SSL and the action is required to be secure'
                    );
                }
            }
        }

        return true;
    }
protected function _secureRequired(Controller $controller)
    {
        if (is_array($this->_config['requireSecure']) &&
            !empty($this->_config['requireSecure'])
        ) {
            $requireSecure = $this->_config['requireSecure'];

            if (in_array($this->_action, $requireSecure) || $requireSecure === ['*']) {
                if (!$this->getController()->getRequest()->is('ssl')) {
                    throw new SecurityException(
                        'Request is not SSL and the action is required to be secure'
                    );
                }
            }
        }

        return true;
    }
protected function _secureRequired ( Controller $ controller ) { if ( is_array ( $ this -> _config [ 'requireSecure' ] ) && ! empty ( $ this -> _config [ 'requireSecure' ] ) ) { $ requireSecure = $ this -> _config [ 'requireSecure' ] ; if ( in_array ( $ this -> _action , $ requireSecure ) || $ requireSecure === [ '*' ] ) { if ( ! $ this -> getController ( ) -> getRequest ( ) -> is ( 'ssl' ) ) { throw new SecurityException ( 'Request is not SSL and the action is required to be secure' ) ; } } } return true ; }
Check if access requires secure connection

@param \Cake\Controller\Controller $controller Instantiating controller
@return bool true if secure connection required
Check if access requires secure connection