반응형
ssl 만료체크
-
python 으로 SSL 만료기간 체크python/기타 2021. 12. 8. 18:25
다양한 사이트를 제작하는 일을 하다보니 SSL 만료기간을 고객쪽에서 놓치는 경우가 있다. 도메인 만료기간 체크처럼 SSL 도 만료기간을 체크할 수 있다. import time from datetime import datetime import ssl, socket def getCertification(): try: domain = 'aaa.co.kr:443' host, port = domain.split(":") port = int(port) context = ssl.create_default_context() conn = context.wrap_socket(socket.socket(socket.AF_INET), server_hostname=host) conn.connect((host, port)) cer..