From 984eac6129047b214294555d1149c0c321a91e6c Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Wed, 18 Sep 2019 13:10:46 +0200 Subject: [PATCH] fix certificate errors on domains with a ccSLD --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 81786f4..36a52a5 100755 --- a/main.py +++ b/main.py @@ -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)