예제 #1
0
def test_https():
    from requests_toolbelt.adapters import host_header_ssl
    import socket

    cache_func = urllib3.util.connection.create_connection

    def wrap_create_connection(address,
                               timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                               source_address=None,
                               socket_options=None):

        address = ("14.215.56.238", "443")
        return cache_func(address, timeout, source_address, socket_options)

    urllib3.util.connection.create_connection = wrap_create_connection

    s = requests.Session()
    s.mount("https://", host_header_ssl.HostHeaderSSLAdapter())
    res = s.get(
        "https://file3.data.weipan.cn/84687038/33aa2de11a520c616796445637c52edf13b9a17f?ip=1575539119,59.42.106.170&ssig=Djju4kRf0E&Expires=1575539719&KID=sae,l30zoo1wmz&fn=%E5%91%A8%E6%9D%B0%E4%BC%A6+-+%E4%B8%83%E9%87%8C%E9%A6%99.mp3&se_ip_debug=59.42.106.170&from=1221134",
        headers={"Host": "file3.data.weipan.cn"},
        stream=True,
        # verify=False,
    )
    content = res.raw.read(44)
    print(content)

    exit(1)
    with requests.Session() as s:
        s = requests.Session()
        s.mount("https://", host_header_ssl.HostHeaderSSLAdapter())
        # res = s.get("http://202.104.186.233:443/84687038/33aa2de11a520c616796445637c52edf13b9a17f?ip=1575535072,59.42.106.170&ssig=9xRrS2tbWs&Expires=1575535672&KID=sae,l30zoo1wmz&fn=%E5%91%A8%E6%9D%B0%E4%BC%A6+-+%E4%B8%83%E9%87%8C%E9%A6%99.mp3&se_ip_debug=59.42.106.170&from=1221134", headers={"Host": "file3.data.weipan.cn"}, stream=True)
        res = s.get("http://ayiis.me/aydocs/download/ex.zip",
                    headers={"Host": "ayiis.me"},
                    stream=True)
        # res = s.get("https://113.113.73.32/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png", headers={"Host": "ss0.bdstatic.com"}, stream=True)
        # res = requests.get(
        #     "https://113.113.73.32/5aV1bjqh_Q23odCf/static/superman/img/logo/bd_logo1_31bdc765.png",
        #     timeout=(3, 3),
        #     headers={
        #         "Host": "ss0.bdstatic.com",
        #     },
        #     stream=True,
        # )
        print(111111111111)
        content = res.raw.read()  # only about content
        print("headers:", res.headers)
        open("akufwigf1b222.png", "wb").write(content)
예제 #2
0
def main():
    repo = SqliteRepository()
    s = sched.scheduler(time.time, time.sleep)

    global session
    session = requests.session()
    if not VERIFY_SSL:
        session.mount('https://', host_header_ssl.HostHeaderSSLAdapter())

    while True:
        try:
            logger.debug("Transmitter: scheduling network transmission...")
            s.enter(TRANSMIT_INTERVAL_SECONDS,
                    SCHEDULE_PRIORITY_DEFAULT,
                    transmit,
                    argument=(repo, ))
            logger.debug("Transmitter: Running scheduler...")
            s.run()
            logger.debug("Transmitter: End of iteration.")
        except KeyboardInterrupt:
            break
        except AuthenticationException as ae:
            logger.error("Transmitter: {0]".format(ae.message))
        except TransmissionException as te:
            logger.error("Transmitter: {0}".format(te.message))
        finally:
            pass
    logger.info("Transmitter: exiting.")
예제 #3
0
def check_proxy(proxy_url, retry=False, through=False):
    s = requests.Session()
    s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
    i = 0
    while i < 3:
        if through:
            try:
                r = s.get('https://' + proxy_url,
                          headers={'Host': 'plex.ruxn.media'},
                          timeout=27.05)
            except requests.exceptions.RequestException:
                if not retry:
                    return False
                i += 1
            else:
                if r.status_code == 401:
                    return True
                else:
                    return False
        else:
            try:
                r = s.get('https://' + proxy_url + '/statuscheck',
                          headers={'Host': 'plex.ruxn.media'},
                          timeout=27.05)
            except requests.exceptions.RequestException:
                if not retry:
                    return False
                i += 1
            else:
                if r.status_code == 200:
                    return True
                else:
                    return False
    return False
예제 #4
0
    def call_api(self, endpoint, method, headers=None, data=None, urldata=None, timeout=None):
        try:
            # covnert server cert to file
            if self.server_cert_file_content_exists is True:
                with open(self.server_cert_name, 'w') as f:
                    try:
                        f.write(self.server_cert_file_content)
                    except IOError:
                        self.logger.error('Failed to setup certificate')

            url = None
            actual_headers = self.headers.copy()
            if headers is not None:
                for header_key in headers:
                    actual_headers[header_key] = headers[header_key]

            if self.url_modifier_function is not None:
                url = self.url_modifier_function(
                    self.server_ip, endpoint, actual_headers)
            else:
                url = 'https://' + self.server_ip + '/' + endpoint
            try:
                session = requests.Session()
                retry_strategy = Retry(total=self.retry_max, backoff_factor=0, status_forcelist=[429, 500, 502, 503, 504],
                                       method_whitelist=["HEAD", "GET", "PUT", "DELETE", "OPTIONS", "TRACE"])
                session.mount("http://", TimeoutHTTPAdapter(max_retries=retry_strategy))

                if self.sni is not None:
                    # only use the tool belt session in case of SNI for safety
                    session.mount('https://', host_header_ssl.HostHeaderSSLAdapter(max_retries=self.retry_max))
                    actual_headers["Host"] = self.sni
                else:
                    session.mount("https://", TimeoutHTTPAdapter(max_retries=retry_strategy))
                call = getattr(session, method.lower())
                it = InterruptableThread(exception_catcher, call, url, headers=actual_headers, params=urldata, data=data,
                                         verify=self.server_cert_content,
                                         timeout=(self.connect_timeout, timeout),
                                         auth=self.auth)
                it.start()
                it.join(timeout)
                if it.is_alive():
                    raise Exception(f'timeout_error ({timeout} sec)')
                response = it.result
                if isinstance(response, Exception):
                    raise response
                if 'headers' in dir(response) and isinstance(response.headers, collections.Mapping) and \
                   'Content-Type' in response.headers and "Deprecated" in response.headers['Content-Type']:
                    self.logger.error("WARNING: " +
                                      response.headers['Content-Type'], file=sys.stderr)
                return ResponseWrapper(response)
            except Exception as e:
                self.logger.error('exception occured during requesting url: ' + str(e))
                raise e
        finally:
            if self.server_cert_file_content_exists is True:
                try:
                    os.remove(self.server_cert_name)
                except OSError as e:
                    if e.errno != errno.ENOENT:
                        raise
예제 #5
0
def getAllStudents() -> list:
    s = requests.Session()
    s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
    response = s.get(BASE_URL + 'students', verify=CERT_PATH, headers=HEADERS)
    if response.status_code != 200:
        return []
    return response.json()
예제 #6
0
def setup_api():
    session = requests.Session()
    session.mount(
        API_HOST,
        host_header_ssl.HostHeaderSSLAdapter(
            max_retries=3,
        ),
    )
    session.headers.update({'Host': PRODUCTION_DOMAIN})
    api_config = {
        'base_url': '%s/api/v2/' % API_HOST,
        'serializer': serialize.Serializer(
            default='json-drf',
            serializers=[
                serialize.JsonSerializer(),
                DrfJsonSerializer(),
            ],
        ),
        'session': session,
    }
    if USER and PASS:
        log.debug(
            'Using slumber v2 with user %s, pointed at %s',
            USER,
            API_HOST,
        )
        session.auth = (USER, PASS)
    else:
        log.warning('SLUMBER_USERNAME/PASSWORD settings are not set')
    return API(**api_config)
예제 #7
0
    def tableau_server_response(self):
        from requests_toolbelt.adapters import host_header_ssl  # avoid top-level import that breaks docs build
        context = self.page_context
        tabserver_url = 'https://{}/trusted/'.format(self.visualization.server.server_name)
        post_arguments = {'username': self.visualization.server.domain_username}
        if self.visualization.server.target_site != 'Default':
            post_arguments.update({'target_site': self.visualization.server.target_site})

        if self.visualization.server.validate_hostname != '':
            request = requests.Session()
            request.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
            tabserver_response = request.post(tabserver_url,
                                              post_arguments,
                                              headers={'Host': self.visualization.server.validate_hostname})
        else:
            tabserver_response = requests.post(tabserver_url, post_arguments)

        if tabserver_response.status_code == 200:
            if tabserver_response.content != b'-1':
                context.update({'ticket': tabserver_response.content.decode('utf-8')})
                return render(self.request, self.template_name, context)
            else:
                context.update({"failure_message": _("Tableau trusted authentication failed")})
                return render(self.request, 'reports/tableau_server_request_failed.html', context)
        else:
            message = _("Request to Tableau failed with status code {}").format(tabserver_response.status_code)
            context.update({"failure_message": message})
            return render(self.request, 'reports/tableau_server_request_failed.html', context)
예제 #8
0
def get_sc(sc):
    s = requests.Session()
    s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
    a = s.get(
        "https://10.62.130.80/backend/public/api/tracking?_dc=1533002388191&ScNoss=true&Field=ORDER_ID&SearchText="
        + sc,
        headers={"Host": "telkom.co.id"})
    return a
예제 #9
0
def getGroups(groupNumber) -> list:
    s = requests.Session()
    s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
    response = s.get(BASE_URL + 'groups/' + groupNumber,
                     verify=CERT_PATH,
                     headers=HEADERS)
    if response.status_code != 200:
        return []
    return response.json()
예제 #10
0
def getAnswers(lessonId) -> list:
    s = requests.Session()
    s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
    response = s.get(BASE_URL + 'quiz/' + str(lessonId) + '/answers',
                     verify=CERT_PATH,
                     headers=HEADERS)
    if response.status_code != 200:
        return []
    return response.json()
예제 #11
0
    def connectDrill(self):
        global tpass
        if self.drill_connected == False:
            try:
                tuser = os.environ['JPY_USER']
            except:
                raise Exception(
                    "Could not find user at ENV JPY_USER - Please use '%drill connect alt' to specify"
                )
            print("Connecting as user %s" % tuser)

            try:
                turl = os.environ['DRILL_BASE_URL']
            except:
                raise Exception(
                    "No DRILL_BASE_URL specified in ENV - Please use '%drill connect alt' to specify"
                )
            print("Connecting to Drill URL: %s" % turl)

            print("")
            print("Now, please enter the password you wish to connect with:")

            tpass = ""
            self.myip.ex(
                "from getpass import getpass\ntpass = getpass(prompt='Drill Connect Password: '******'tpass']
            self.session = requests.Session()

            if self.drill_pin_to_ip == True:

                tipurl = self.getipurl(turl)
                print("")
                print("Pinning to IP for this session: %s" % tipurl)
                print("")
                self.drill_base_url = tipurl
                self.session.mount(tipurl,
                                   host_header_ssl.HostHeaderSSLAdapter())

            else:
                self.drill_base_url = turl
            self.drill_user = tuser
            self.drill_pass = tpass
            self.myip.user_ns['tpass'] = ""
            #try:
            if 1 == 1:
                self.session = self.authDrill()
                self.drill_connected = True
                print("%s - Drill Connected!" % self.drill_base_url)
            #except:
            #    print("Connection Error - Perhaps Bad Usename/Password?")

        else:
            print(
                "Drill is already connected - Please type %drill for help on what you can you do"
            )
예제 #12
0
    def _load_url(source, timeout, host):
        """Load contents from URL"""
        headers = {}
        if host:
            headers.update({'HOST': host})

        sess = Session()
        sess.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
        response = sess.get(source, timeout=timeout, headers=headers)

        return response.text if response else None
예제 #13
0
def main():
    """
    Main function
    """
    request_session = requests.Session()
    request_session.mount('https://', host_header_ssl.HostHeaderSSLAdapter())

    response = request_session.get(
        'https://1.2.3.4', headers={'Host': 'example.com'}, verify=True)

    print(response.text)
예제 #14
0
def getTeachers(searchPhraze) -> list:
    namePattern = "%" + searchPhraze + "%"
    namePattern.replace(' ', '%')

    s = requests.Session()
    s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
    response = s.get(BASE_URL + 'teachers/' + namePattern,
                     verify=CERT_PATH,
                     headers=HEADERS)
    if response.status_code != 200:
        return []
    return response.json()
예제 #15
0
 def __init__(self):
     self.code = ""
     session = requests.Session()
     session.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
     self.requests = session
     self.code_verifier, self.code_challenge = self.oauth_pkce(self.s256)
     self.login_params = {
         "code_challenge": self.code_challenge,
         "code_challenge_method": "S256",
         "client": "pixiv-android",
     }
     self.msger = biuMsg("Login")
예제 #16
0
def postNewQuestion(lessonId, text) -> bool:
    answerData = {"answer_type": 'questions', "answer": text}

    s = requests.Session()
    s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
    response = s.post(BASE_URL + 'quiz/' + str(lessonId),
                      data=answerData,
                      verify=CERT_PATH,
                      headers=HEADERS)
    if response.status_code != 200:
        return False
    return True
 def vault_auth(self):
     vault_client = hvac.Client(url=os.environ['VAULT_ADDR'],
                                token=os.environ['VAULT_TOKEN'])
     vault_client.session.mount('https://',
                                host_header_ssl.HostHeaderSSLAdapter())
     vault_client.session.headers['Host'] = VAULT_TLS_SERVER_NAME
     token = vault_client.auth_approle(
         vault_client.read(ROLE_ID_PATH)['data']['role_id'],
         vault_client.write(SECRET_ID_PATH)['data']
         ['secret_id'])['auth']['client_token']
     vault_client.token = token
     return vault_client
예제 #18
0
def setup_api():
    session = Session()
    session.mount(API_HOST, host_header_ssl.HostHeaderSSLAdapter())
    session.headers.update({'Host': PRODUCTION_DOMAIN})
    api_config = {
        'base_url': '%s/api/v1/' % API_HOST,
        'session': session,
    }
    if USER and PASS:
        log.debug('Using slumber with user %s, pointed at %s', USER, API_HOST)
        session.auth = (USER, PASS)
    else:
        log.warning('SLUMBER_USERNAME/PASSWORD settings are not set')
    return API(**api_config)
예제 #19
0
def getQuestions(lessonId) -> list:
    s = requests.Session()
    s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
    response = s.get(BASE_URL + 'quiz/' + str(lessonId),
                     verify=CERT_PATH,
                     headers=HEADERS)
    if response.status_code != 200:
        return []
    questions = []
    for element in response.json():
        questions.append(
            Question(element['question']['id'], element['question']['text'],
                     element['question']['type']))
    return questions
예제 #20
0
 def ssl_url_check_custom_IP(self, node_ip):
     self.node_ip = node_ip
     https_url_ip = 'https://' + self.node_ip + self.uri
     s = requests.Session()
     s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
     try:
         rhttps = s.get(https_url_ip,
                        headers={"Host": self.domain_name},
                        timeout=5)
         return rhttps.status_code
     except requests.ConnectTimeout:
         return "TimeOut_Error"
     except requests.ConnectionError:
         return "Connection_Error"
예제 #21
0
    def call_api(self, endpoint, method, headers=None, params=[], data=None, urldata=None, timeout=None):
        try:
            # covnert server cert to file
            if self.server_cert_file_content_exists is True:
                with open(self.server_cert_name, 'w') as f:
                    try:
                        f.write(self.server_cert_file_content)
                    except IOError:
                        self.logger.error('Failed to setup certificate')

            url = None
            actual_headers = self.headers.copy()
            if headers is not None:
                for header_key in headers:
                    actual_headers[header_key] = headers[header_key]

            if self.url_modifier_function is not None:
                url = self.url_modifier_function(
                    self.server_ip, endpoint, actual_headers)
            else:
                url = 'https://' + self.server_ip + '/' + endpoint
            try:
                call = getattr(requests, method.lower())

                # only use the tool belt session in case of SNI for safety
                if self.sni is not None:
                    session = requests.Session()
                    call = getattr(session, method.lower())
                    session.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
                    actual_headers["Host"] = self.sni

                response = call(url, headers=actual_headers, params=urldata, data=data, verify=self.server_cert_content,
                                timeout=timeout)

                if 'headers' in dir(response) and isinstance(response.headers, collections.Mapping) and \
                   'Content-Type' in response.headers and "Deprecated" in response.headers['Content-Type']:
                    self.logger.error("WARNING: " +
                          response.headers['Content-Type'], file=sys.stderr)
                return ResponseWrapper(response)
            except Exception as e:
                self.logger.error('exception occured during requesting url: ' + str(e))
                raise e
        finally:
            if self.server_cert_file_content_exists is True:
                try:
                    os.remove(self.server_cert_name)
                except OSError as e:
                    if e.errno != errno.ENOENT:
                        raise
예제 #22
0
def setTeacherChatId(teacherId, chatId) -> bool:
    data = {"id": int(teacherId), "telegram_id": int(chatId)}

    print(data)

    s = requests.Session()
    s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
    response = s.patch(BASE_URL + 'teachers',
                       data=data,
                       verify=CERT_PATH,
                       headers=HEADERS)
    print(response.status_code)
    if response.status_code != 200:
        return False
    return True
예제 #23
0
    def session(self):
        if self._session is None:
            self._session = requests.Session()

            # Enables HostHeaderSSLAdapter
            # https://toolbelt.readthedocs.io/en/latest/adapters.html#hostheaderssladapter
            if self.tls_use_host_header:
                self._session.mount('https://',
                                    host_header_ssl.HostHeaderSSLAdapter())

            # Attributes can't be passed to the constructor
            for option, value in iteritems(self.options):
                setattr(self._session, option, value)

        return self._session
예제 #24
0
파일: https.py 프로젝트: dsf3449/sensors
    def __init__(self, typ, **kwargs):
        # Make sure required elements are present
        get_config_element(CFG_TRANSPORT_HTTPS_AUTH_URL, kwargs,
                           CFG_PROPERTIES)
        get_config_element(CFG_URL, kwargs, CFG_PROPERTIES)
        get_config_element(CFG_TRANSPORT_HTTPS_JWT_ID, kwargs, CFG_PROPERTIES)
        get_config_element(CFG_TRANSPORT_HTTPS_JWT_KEY, kwargs, CFG_PROPERTIES)
        super().__init__(typ, **kwargs)

        self.jwt_token = (None, None)
        self.session = requests.session()
        if not self.verify_ssl():
            self.session.mount('https://',
                               host_header_ssl.HostHeaderSSLAdapter())
        self.auth_ttl = self.jwt_token_ttl_minutes()
        self.logger = None
예제 #25
0
    def session(self):
        if self._session is None:
            self._session = requests.Session()

            # Enables HostHeaderSSLAdapter
            # https://toolbelt.readthedocs.io/en/latest/adapters.html#hostheaderssladapter
            if self.tls_use_host_header:
                self._session.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
            # Enable Unix Domain Socket (UDS) support.
            # See: https://github.com/msabramo/requests-unixsocket
            self._session.mount('{}://'.format(UDS_SCHEME), requests_unixsocket.UnixAdapter())

            # Attributes can't be passed to the constructor
            for option, value in iteritems(self.options):
                setattr(self._session, option, value)

        return self._session
def test_durum(make_message_edns, host, ip, record_type, dnssec):
    """Tests durum, Wikidough's check service at check.wikimedia-dns.org.

    This check works by querying for *.check.wikimedia-dns.org; if the query
    comes from a Wikidough host, gdnsd returns DURUM_YES_IP*. For all other
    cases, it returns DURUM_NO_IP.

    What about ECS? Again, gdnsd takes care of that by ignoring ECS for
    checkdoh-map in geo-maps by setting `ignore_ecs => true'; this allows us to
    see the recursor IP address instead of the client's, even though ECS is set
    by pdns-recursor for queries to WMF auth servers, as shown in
    test_dot_ecs_query_*.
    """
    # Query went through Wikidough, gdnsd should return the "yes" IP.
    response_wikidough = dns.query.tls(make_message_edns, RESOLVER_IP,
                                       record_type)
    assert DURUM_YES_IP_DOT == get_rrset(response_wikidough)
    assert DURUM_YES_IP_DOH != get_rrset(response_wikidough)

    # Query went through 8.8.8.8, gdnsd should return the "no" IP.
    response_not_wikidough = dns.query.tls(make_message_edns, '8.8.8.8',
                                           record_type)
    assert DURUM_NO_IP == get_rrset(response_not_wikidough)

    # Test the actual web application that users access. To do this, we will
    # need requests_toolbelt to create a request to the yes/no IP, with the
    # specified SNI.
    #
    # See puppet: modules/profile/templates/durum/nginx.conf.erb.
    durum_url = 'https://{ip}/check'

    secure_r = requests.Session()
    secure_r.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
    headers = {"Host": host}

    response_yes = secure_r.get(durum_url.format(ip=DURUM_YES_IP_DOH),
                                headers=headers)
    response_yes.raise_for_status()
    assert response_yes.json()['wikidough']
    assert response_yes.json()['service'] == "doh"

    response_no = secure_r.get(durum_url.format(ip=DURUM_NO_IP),
                               headers=headers)
    response_no.raise_for_status()
    assert not response_no.json()['wikidough']
예제 #27
0
    def addkey(self):
        # Get common name and IP address for wireguard endpoint in region
        cn = self.server_list[self.region]['servers']['wg'][0]['cn']
        ip = self.server_list[self.region]['servers']['wg'][0]['ip']

        s = requests.Session()
        s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
        s.verify = 'ca.rsa.4096.crt'

        r = s.get("https://{}:1337/addKey?pt={}&pubkey={}".format(
            ip, urllib.parse.quote(self.token),
            urllib.parse.quote(self.publickey)),
                  headers={"Host": cn})
        if r.status_code == 200 and r.json()['status'] == 'OK':
            self.connection = r.json()
            return True, r.content
        else:
            return False, r.content
예제 #28
0
def createNewStudent(groupId, telegramId, login="") -> bool:
    if len(login) == 0:
        studentData = {"group_id": groupId, "telegram_id": telegramId}
    else:
        studentData = {
            "login": login,
            "group_id": groupId,
            "telegram_id": telegramId
        }

    s = requests.Session()
    s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
    response = s.post(BASE_URL + 'students',
                      data=studentData,
                      verify=CERT_PATH,
                      headers=HEADERS)
    if response.status_code != 200:
        return False
    return True
예제 #29
0
    def get_token(self, username, password):
        # Get common name and IP address for metadata endpoint in region
        meta_cn = self.server_list[self.region]['servers']['meta'][0]['cn']
        meta_ip = self.server_list[self.region]['servers']['meta'][0]['ip']

        # Some tricks to verify PIA certificate, even though we're sending requests to an IP and not a proper domain
        # https://toolbelt.readthedocs.io/en/latest/adapters.html#requests_toolbelt.adapters.host_header_ssl.HostHeaderSSLAdapter
        s = requests.Session()
        s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
        s.verify = 'ca.rsa.4096.crt'

        r = s.get("https://{}/authv3/generateToken".format(meta_ip),
                  headers={"Host": meta_cn},
                  auth=(username, password))
        data = r.json()
        if r.status_code == 200 and data['status'] == 'OK':
            self.token = data['token']
            return True
        else:
            return False
예제 #30
0
def issue_comment(event, context):

    comment = {
        # "body": os.environ["body"]
    }
    #r = requests.get(url = URL, json=query)
    s = requests.Session()
    s.mount('https://', host_header_ssl.HostHeaderSSLAdapter())
    # r = s.get("https://93.184.216.34")
    r = s.get("https://93.184.216.34", headers={"Host": "example.org"})
    # r = requests.post(url = URL, json=comment, auth=(USER,PASSWORD))

    # data = r.json()

    print(r.status_code)
    print(r.text)

    print("Python version:")
    print(sys.version)
    print("hello world")