#!/usr/bin/env python3

import sys
import ssl
import socket

s = socket.create_connection(("localhost", 1965))
context = ssl.SSLContext()
context.check_hostname = False
context.verify_mode = ssl.CERT_NONE
if len(sys.argv) == 4:
    context.load_cert_chain(certfile=sys.argv[2], keyfile=sys.argv[3])
s = context.wrap_socket(s, server_hostname = "localhost")
s.sendall((sys.argv[1] + '\r\n').encode("UTF-8"))
fp = s.makefile("rb")
body = fp.read()
print(body.decode("UTF-8"))
