Check HTTP connectivity and TLS certs - Python

Development | Programming languages
5.00 €
Money-Back Guarantee
from requests import get
from argparse import ArgumentParser
from os.path import exists
from checktls import check_cert

def __get_args():
    parser = ArgumentParser(description='Check HTTP connectivity and TLS certs')
    parser.add_argument('url', help='URL to hit')
    parser.add_argument('output', help='path to output file')
    args = parser.parse_args()
    return args

def __get_data(url):
    resp = get(url)
    http_code = resp.status_code
    response_time = resp.elapsed.microseconds / 1000000.
    base_host = resp.request.url[:-len(resp.request.path_url)]
    if base_host.startswith('http'):
        base_host = base_host.split('/')[-1]
    error, days_left = check_cert(base_host)
    is_ok = error == 0
No attachments
You must log in or purchase one of our profile products to access.
All coments
This job has not been commented yet.

We use cookies to give you the best possible experience on our site. By continuing to use the site you agree to our use of cookies. Find out more Accept