Skip to content

Instantly share code, notes, and snippets.

@chliny
Created January 15, 2015 15:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chliny/b632003d96d0029237b3 to your computer and use it in GitHub Desktop.
Save chliny/b632003d96d0029237b3 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
#-*- coding=utf-8 -*-
import requests
def checkCrt(ip):
try:
requests.get("https://%s" % ip, verify=True)
except requests.exceptions.SSLError as e:
ret_list = str(e).replace(",","").split("'")
domain_list = ret_list[4:]
except Exception as e:
print (e)
return False
for domain in domain_list:
domain = domain.strip()
if domain:
print (ip,domain)
if __name__ == "__main__":
import sys
ip = sys.argv[1]
checkCrt(ip)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment