INNER CODE UNIT · Python

make_post_quantum_request_with_openssl

open-quantum-safe/oqs-demos · locust/scenarios/locustfile.py:28

    def make_post_quantum_request_with_openssl(self, endpoint):
        try:
            logger.debug(f"Making request to {url}{endpoint} with group {group}")
            host_and_port = host + ":" + str(port)
            http_headers="Post-quantum"
            request_name = f"Group {group} {endpoint}"

            start = time.time()
            result = subprocess.run(
                ["openssl", "s_client", "-groups", group, "-connect", host_and_port, "-ign_eof"],
                input=f"GET {endpoint} HTTP/1.1\r\n"
                      f"Host: {host}\r\n"
                      f"User-Agent: {http_headers}\r\n"
                      f"Connection: close\r\n\r\n",
                capture_output=True, text=True
            )
            total = int((time.time() - start) * 1000)
            logger.debug(f"result: {result.stdout}")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…