fix certificate errors on domains with a ccSLD

master
Michele Guerini Rocco 2019-09-18 13:10:46 +02:00
parent 5498e1de87
commit 984eac6129
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450
1 changed files with 5 additions and 1 deletions

View File

@ -184,7 +184,11 @@ class FrontRequestHandler(ProxyRequestHandler):
f'Proxy-agent: {self.version_string()}\r\n'
'\r\n').encode('ascii'))
if self.host.count('.') >= 2:
commonname = '.' + self.host.partition('.')[-1]
isccSLD = len(self.host.split('.')[-2]) <= 3
if isccSLD:
commonname = self.host
else:
commonname = '.' + self.host.partition('.')[-1]
else:
commonname = self.host
dummycert = get_cert(commonname, config)