#!/usr/bin/env python
import sys
sys.path.insert(0, "../../")
from libmproxy import certutils

if len(sys.argv) > 2:
    port = int(sys.argv[2])
else:
    pport = 443

cn, san = certutils.get_remote_cn(sys.argv[1], port)
print cn
if san:
    for i in san:
        print "\t", i


