From b9b67b16b9f5a1ac55833c5638a314922a04077c Mon Sep 17 00:00:00 2001 From: byb11 Date: Fri, 26 Mar 2021 15:09:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8E=B7=E5=8F=96=E7=BD=91?= =?UTF-8?q?=E9=A1=B5=E8=AF=81=E4=B9=A6=E4=BF=A1=E6=81=AF=E5=85=B3=E9=94=AE?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 04-CustomLibrary/Custometest/UIAssert.py | 29 +++++++++++++++--------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/04-CustomLibrary/Custometest/UIAssert.py b/04-CustomLibrary/Custometest/UIAssert.py index 1515704..267c100 100644 --- a/04-CustomLibrary/Custometest/UIAssert.py +++ b/04-CustomLibrary/Custometest/UIAssert.py @@ -1,15 +1,22 @@ import ssl, socket +# content of test_json_schema.py +from jsonschema import validators + + #获取页面证书信息 def ttt(): - hostname = 'vip.com' - ctx = ssl.create_default_context() - with ctx.wrap_socket(socket.socket(), server_hostname=hostname) as s: - s.connect((hostname, 443)) - cert = s.getpeercert() - - subject = dict(x[0] for x in cert['subject']) - issued_to = subject['commonName'] - issuer = dict(x[0] for x in cert['issuer']) - issued_by = issuer['commonName'] - print(issued_by) \ No newline at end of file + hostname = 'vip.com' + ctx = ssl.create_default_context() + with ctx.wrap_socket(socket.socket(), server_hostname=hostname) as s: + s.connect((hostname, 443)) + cert = s.getpeercert() + + subject = dict(x[0] for x in cert['subject']) + issued_to = subject['commonName'] + issuer = dict(x[0] for x in cert['issuer']) + issued_by = issuer['commonName'] + print(issued_by) + + +