~zethra/stargazer

ref: fbbf828c33087d1601d81db7c99c41d71fcb930f stargazer/scripts/gemreq -rwxr-xr-x 494 bytes
fbbf828c — Ben Aaron Goldberg config: add bad config for testing 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env python3

import sys
import ssl
import socket
import urllib.parse

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"))