def check_that_request_is_valid(signature_certificate_url, request, raw_body)
      certificate, chain = AlexaVerifier::CertificateStore.fetch(signature_certificate_url) if @configuration.verify_certificate? || @configuration.verify_signature?

      begin
        AlexaVerifier::Verifier::CertificateVerifier.valid!(certificate, chain) if @configuration.verify_certificate?

        check_that_request_was_signed(certificate.public_key, request, raw_body) if @configuration.verify_signature?
      rescue AlexaVerifier::InvalidCertificateError, AlexaVerifier::InvalidRequestError => error
        # We don't want to cache a certificate that fails our checks as it could lock us out of valid requests for the cache length
        AlexaVerifier::CertificateStore.delete(signature_certificate_url)

        raise error
      end
    end
def check_that_request_is_valid(signature_certificate_url, request, raw_body)
      certificate, chain = AlexaVerifier::CertificateStore.fetch(signature_certificate_url) if @configuration.verify_certificate? || @configuration.verify_signature?

      begin
        AlexaVerifier::Verifier::CertificateVerifier.valid!(certificate, chain) if @configuration.verify_certificate?

        check_that_request_was_signed(certificate.public_key, request, raw_body) if @configuration.verify_signature?
      rescue AlexaVerifier::InvalidCertificateError, AlexaVerifier::InvalidRequestError => error
        # We don't want to cache a certificate that fails our checks as it could lock us out of valid requests for the cache length
        AlexaVerifier::CertificateStore.delete(signature_certificate_url)

        raise error
      end
    end
Check that our request is valid.

 @param [String] signature_certificate_url the url for our signing certificate
 @param [Rack::Request::Env] request the request object
 @param [String] raw_body the raw body of our https request