Update server.py
This commit is contained in:
parent
376a920271
commit
c5d2eb66cc
1 changed files with 1 additions and 1 deletions
|
@ -99,10 +99,10 @@ def relay():
|
||||||
gsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
gsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
fulladdr = "gemini://" + url + ("?" + queries if queries != None else "")
|
fulladdr = "gemini://" + url + ("?" + queries if queries != None else "")
|
||||||
contx = ssl.create_default_context()
|
contx = ssl.create_default_context()
|
||||||
|
contx.check_hostname = False
|
||||||
contx.verify_mode = ssl.CERT_NONE
|
contx.verify_mode = ssl.CERT_NONE
|
||||||
if certfile:
|
if certfile:
|
||||||
contx.load_cert_chain(certfile=homefolder + "/certs/" + certfile + "-chain.pem", keyfile=homefolder + "/certs/" + certfile + "-privkey.pem");
|
contx.load_cert_chain(certfile=homefolder + "/certs/" + certfile + "-chain.pem", keyfile=homefolder + "/certs/" + certfile + "-privkey.pem");
|
||||||
contx.check_hostname = False;
|
|
||||||
gemsocket = contx.wrap_socket(gsocket)
|
gemsocket = contx.wrap_socket(gsocket)
|
||||||
gemsocket.connect((urlparse(fulladdr).hostname, 1965))
|
gemsocket.connect((urlparse(fulladdr).hostname, 1965))
|
||||||
gemsocket.send(bytes(fulladdr + "\r\n", "UTF-8"))
|
gemsocket.send(bytes(fulladdr + "\r\n", "UTF-8"))
|
||||||
|
|
Loading…
Add table
Reference in a new issue