Example #1
0
    def _create_response(self, flow):
        response = Response(
            status_code=flow.response.status_code,
            reason=flow.response.reason,
            headers=[(k, v)
                     for k, v in flow.response.headers.items(multi=True)],
            body=flow.response.raw_content,
        )

        cert = flow.server_conn.cert
        if cert is not None:
            response.cert = dict(
                subject=cert.subject,
                serial=cert.serial,
                key=cert.keyinfo,
                signature_algorithm=cert.x509.get_signature_algorithm(),
                expired=cert.has_expired,
                issuer=cert.issuer,
                notbefore=cert.notbefore,
                notafter=cert.notafter,
                organization=cert.organization,
                cn=cert.cn,
                altnames=cert.altnames,
            )

        return response
Example #2
0
    def _create_response(self, flow):
        response = Response(
            status_code=flow.response.status_code,
            reason=flow.response.reason,
            headers=[(k, v) for k, v in flow.response.headers.items()],
            body=flow.response.raw_content
        )

        cert = flow.server_conn.cert
        if cert is not None:
            response.cert = dict(
                subject=cert.subject,
                serial=cert.serial,
                key=cert.keyinfo,
                signature_algorithm=cert.x509.get_signature_algorithm(),
                expired=cert.has_expired,
                issuer=cert.issuer
            )

        return response