SSLError after host azure changed tls certificate root

Posted almost 4 years ago by kevin.marti

Post a topic
Un Answered
k
kevin.marti

Hello there 


since our hosting provider azure changed their TLS certificates our python crawler azure function apps get the following error after their update: 

Found Python version 3.7.6 (py).

Azure Functions Core Tools
Core Tools Version:       3.0.2996 Commit hash: c54cdc36323e9543ba11fb61dd107616e9022bba
Function Runtime Version: 3.0.14916.0


Functions:

        TestFunction: [GET,POST] http://localhost:7071/api/TestFunction

For detailed output, run func with --verbose flag.
[2020-11-19T09:00:02.430Z] Host lock lease acquired by instance ID '000000000000000000000000F942B1F6'.
[2020-11-19T09:00:03.112Z] Worker process started and initialized.
[2020-11-19T09:01:09.048Z] Executing 'Functions.TestFunction' (Reason='This function was programmatically called via the host APIs.', Id=fb0fde9e-15a9-43b5-9c7e-3e04721f2733)
[2020-11-19T09:01:09.109Z] Python HTTP trigger function processed a request.
[2020-11-19T09:01:09.486Z] Executed 'Functions.TestFunction' (Failed, Id=fb0fde9e-15a9-43b5-9c7e-3e04721f2733, Duration=441ms)
[2020-11-19T09:01:09.492Z] System.Private.CoreLib: Exception while executing function: Functions.TestFunction. System.Private.CoreLib: Result: Failure
Exception: SSLError: HTTPSConnectionPool(host='de.wikipedia.org', port=443): Max retries exceeded with url: /wiki/Wikipedia:Hauptseite (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1076)')))
Stack:   File "C:\Users\martikev\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 349, in _handle__invocation_request
    self.__run_sync_func, invocation_id, fi.func, args)
  File "C:\Users\martikev\Anaconda3\lib\concurrent\futures\thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "C:\Users\martikev\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\3.7/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 511, in __run_sync_func
    return func(**params)
  File "C:\Users\martikev\Datalake Yang\Azure Functions\PySpiders\monetas\TestFunction\__init__.py", line 21, in main
    verify=False)
  File "c:\Users\martikev\Datalake Yang\Azure Functions\PySpiders\monetas\.venv\lib\site-packages\requests\api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "c:\Users\martikev\Datalake Yang\Azure Functions\PySpiders\monetas\.venv\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "c:\Users\martikev\Datalake Yang\Azure Functions\PySpiders\monetas\.venv\lib\site-packages\requests\sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\Users\martikev\Datalake Yang\Azure Functions\PySpiders\monetas\.venv\lib\site-packages\requests\sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "c:\Users\martikev\Datalake Yang\Azure Functions\PySpiders\monetas\.venv\lib\site-packages\requests\adapters.py", line 514, in send
    raise SSLError(e, request=request)

  This only happens if we request https website pages. Do you know why this happens and how to fix it? 


I have added a simple function app with a http trigger. To start project/environment:

  • unzip project
  • open in vs code
  • add proxy_key in file init.py
  • send http request to local host example in sampleHttpRequest.http
  • use vs code "rest client" extension so you can send http request directly from vs code
We await your response thank you. 

0 Votes


1 Comments

k

kevin.marti posted almost 4 years ago

you have to change the Proxy_port to 8013

0 Votes

Login to post a comment