Scraper error log diagnosis

Hi All,

I’ve been using a web scraper to report the status of a free EV charger around the corner from my house. It’s been working rock solidly for several weeks but recently the sensor stopped loading and the following is visible in the logs:

Logger: homeassistant.components.sensor
Source: components/rest/data.py:60
Integration: Sensor (documentation, issues)
First occurred: 12:28:23 (1 occurrences)
Last logged: 12:28:23

Error while setting up scrape platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/scrape/sensor.py", line 108, in async_setup_platform
    await rest.async_update()
  File "/usr/src/homeassistant/homeassistant/components/rest/data.py", line 60, in async_update
    response = await self._async_client.request(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1527, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1614, in send
    response = await self._send_handling_auth(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1642, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1679, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_client.py", line 1716, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpx/_transports/default.py", line 353, in handle_async_request
    resp = await self._pool.handle_async_request(req)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 253, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 237, in handle_async_request
    response = await connection.handle_async_request(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 86, in handle_async_request
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 63, in handle_async_request
    stream = await self._connect(request)
  File "/usr/local/lib/python3.10/site-packages/httpcore/_async/connection.py", line 150, in _connect
    stream = await stream.start_tls(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 76, in start_tls
    raise exc
  File "/usr/local/lib/python3.10/site-packages/httpcore/backends/asyncio.py", line 67, in start_tls
    ssl_stream = await anyio.streams.tls.TLSStream.wrap(
  File "/usr/local/lib/python3.10/site-packages/anyio/streams/tls.py", line 122, in wrap
    await wrapper._call_sslobject_method(ssl_object.do_handshake)
  File "/usr/local/lib/python3.10/site-packages/anyio/streams/tls.py", line 130, in _call_sslobject_method
    result = func(*args)
  File "/usr/local/lib/python3.10/ssl.py", line 975, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: WRONG_SIGNATURE_TYPE] wrong signature type (_ssl.c:997)

I can see there is an SSL related error towards the end but I’m not scraping an SSL URL. Can anyone else help diagnose?

Thank you

I’m afraid the only way you arrive at that error message is if the URL starts with https. Is it possible that the webserver you are scraping from is actually redirecting you from http to https along the way?

Hmm, you’re right. When I visit the URL manually it does indeed redirect to an SSL. Any advice on the next steps from here?

The error message that you get (WRONG_SIGNATURE_TYPE) indicates that the SSL certificate provided by the external webserver is not trusted by Home Assistant, and should be upgraded on the server side.

Now, there is an option in the scrape called verify_ssl that you can set to false to potentially ignore this error, but I really would not recommend to use this with an external webserver.

Ah I see, well thanks very much for your help! I’ll have to see if there is another way to access this data.