Kasa Camera Integration TLS handshake failure after Hubitat 2.5.0.143

Hi @djgutheinz,

I believe I have found a Hubitat platform compatibility issue affecting the Kasa Camera Integration.

My Kasa cameras stopped responding through Hubitat after I upgraded the hub to platform 2.5.1.152 on Sunday, 16 August. They continued to work normally through the Kasa app.

Example camera:

  • Model: KC410S

  • Hardware version: 1.0

  • Firmware version: 2.3.27

Troubleshooting completed:

  • Turned Third-Party Compatibility off and back on in the Kasa app

  • Power-cycled the camera

  • Tested the camera directly from its Hubitat device page, bypassing all rules, virtual switches and Home Assistant

  • Both Privacy commands and Poll failed

  • Restored Hubitat to 2.5.0.159: still failed

  • Restored Hubitat to 2.5.0.143: camera control and Poll immediately worked again

  • Confirmed the Hubitat virtual switches, pistons and Home Assistant controls also work again on 2.5.0.143

On the failing platform versions, Hubitat reports status 408 with:

Received fatal alert: handshake_failure

This affects both status requests such as:

system:get_sysinfo

and camera commands such as:

smartlife.cam.ipcamera.switch:set_is_enable

Therefore, the regression appears to have been introduced somewhere between platform versions 2.5.0.143 and 2.5.0.159—possibly alongside the IoT dependency-library update in 2.5.0.153.

I have remained on 2.5.0.143 for now. Please let me know if you would like additional logs, driver-version details or any other testing.

Thanks,
Steve

HTTP 408: HTTP 408 (Request Timeout) means the server did not receive the complete request from the client within the time it was willing to wait. The server closes the connection and returns a 408 status

Need you to upgrade Hubitat to 2.5.1 xxx (current version). The issue seems with the Hubitat https implementation. This happened on one of the previous versions. I actually saw this on one version and did a quick regression while the team fixed the issue.

Also check that the camera IP address in Hubitat is the same as that in the Kasa phone app.

Thank you for your prompt reply. I verified that the camera IP addresses are correct.

Platform 2.5.1.152 is the version on which the HTTPS handshake failure occurred. It also fails on 2.5.0.159, while the same camera, IP address and driver work immediately after rolling back to 2.5.0.143. Is there a newer 2.5.1 build or hotfix you would like me to test?

Sorry for the confusion.

Does the Firmware have a build number (this indicates the creation date). Issue is that the 2.3.27 fw is not listed in the TP-link support site for this device. latest is 2.3.26. Kasa (tpLink) has been messing with the login procedures over the last few months and that MAY (or may not) be the issue.

I will be testing later today on my camera (have to pull out of storage).

OK. Tested. Failure confirmed on bo2.5.1 and 2.5.0.159.

@gopher.ny

Hub model: C7

Hub version: 2.5.1.158

History: based on user input

  • Somewhere prior to 2.5.0.143 - worked.
  • 2.5.0.143 and later: does not work.
  • Confirmation: I confirmed the failure on the version 2.5.0.159 and 2.5.1.158!

The error is may be a continuation HTTP issues that occurred while doing developing 2.5.0.

The httpPost is embedded in a try (below). The body is a string representing the byte version of a HEX string. The same error occurs on the asyncHttpPost!

def reqParams = [
    uri:https://192.168.50.233:10443/data/LINKIE.json,
    body:content=0PKB%2BIv%2FmvfV75S20bTAn%2ByV5o%2Fhh%2BjK8Kv2i%2FY%3D,
    contentType:application/octet-stream, 
    ignoreSSLIssues:true,  
    headers:[
        Authorization:Basic ZGPNDXROZWLUEKBVDXRSB29RLMNVBTPAR3BUTVRNNE9XUNFADZ09
    ],
    timeout:4
]

COMMAND (Embedded in a try)
try {
    httpPost(reqParams) { resp ->
      logData << [status: resp.status]
	  [NOTE THAT FAILURE NEVER GETS TO THIS BRANCH!]
    }
  } catch (err) {
    logData << [status: "httpError", error: err]
    logWarn(logData)
  }

Value of "err":
   javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

Regards, Dave Gutheinz

Noted, checking it out.

Thank you both.

Just one correction to the version history: 2.5.0.143 definitely works with the same cameras, IP addresses and Kasa Camera Integration configuration.

My confirmed results are:

  • 2.5.0.143 — working
  • 2.5.0.159 — SSL handshake failure
  • 2.5.1.152 — SSL handshake failure

Dave has now also confirmed the failure on 2.5.1.158.

Therefore, the regression appears to have been introduced sometime after 2.5.0.143. I am remaining on 2.5.0.143 for now, but I am happy to test a fixed build when one becomes available.

Regards, Steve

Thanks, Dave. That is encouraging.

At present, the latest update offered by my hub is 2.5.1.152, which I have already tested and confirmed produces the SSL handshake failure. Version 2.5.1.166 is not currently available to me.

Is 2.5.1.166 a beta or staged release, or should I simply wait until it becomes available through the normal update process? I am currently remaining on the working 2.5.0.143.

Thanks, Steve

The Kasa Camera package has been updated and placed in Hubitat Package Manager. It is also available on GitHub at: GitHub - DaveGut/kasaCam_Hubitat · GitHub

Version: Requires Hub Version 2.5.1.166 or later. Earlier versions may not work.

Changes: Added "Connection: close" to the headers in asyncHttpPost and syncHttpPost command params.

Testing:

  1. Loaded onto system using HPM.
  2. Installed my KC115 camera.
  3. Enabled debug logging to assure log messages.
  4. Ran poll and enable commands (sufficient since the issue was in the two methods asyncPost and syncPost).
  5. Observation: worked as specified.

I have just updated my Hub to 2. 5. 1. 174 and all working perfectly. Thank you very much for the fix!