Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tls: handshake failure for kasa:// camera #1172

Closed
Sammy1Am opened this issue Jun 7, 2024 · 10 comments
Closed

tls: handshake failure for kasa:// camera #1172

Sammy1Am opened this issue Jun 7, 2024 · 10 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Sammy1Am
Copy link

Sammy1Am commented Jun 7, 2024

After updating to 1.9.3, I'm getting the following error repeated in the logs:

04:33:31.177 WRN [rtsp] error="streams: Get \"https://my@email.com:***@cameraname:19443/https/stream/mixed\": remote error: tls: handshake failure" stream=stream_name

The configuration YAML has the following:

streams:
    stream_name: kasa://my@email.com:passwordhash@cameraname:19443/https/stream/mixed

Rolling back to 1.9.2 resolves the issue. Did something change requiring me to change the configuration?

@iamer
Copy link

iamer commented Jun 7, 2024

I have the same issue with a reolink doorbell

@AlexxIT AlexxIT added the bug Something isn't working label Jun 7, 2024
@AlexxIT AlexxIT self-assigned this Jun 7, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Jun 7, 2024

I can confirm problem with Reolink cameras. It doesn't make much sense to connect to them over HTTPS.
The problem is related to the upgrade to go1.22.

@AlexxIT AlexxIT added this to the v1.9.4 milestone Jun 7, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Jun 7, 2024

Fixed in master version

@skrashevich
Copy link
Contributor

@AlexxIT what about bugfix release v1.9.3.1?

@dubsaveli
Copy link

@AlexxIT I am trying to set up my Kasa cameras in go2rtc, and I have not been able to figure out how to configure the link URL correctly.

For my username, I gathered that I am supposed to use the URL-safe email with "%40" in place of "@". Is this true?

For the password, I saw that I am to use my Kasa account password but base64 encrypted. When I tried that in my URL, along with my URL-safe email, I was getting tls handshake errors. I saw in the documentation mention of "secret1 -> c2VjcmV0MQ==", which I was confused by. I was hoping that you could offer some direction on what I'm doing wrong and misunderstanding.

Thank you in advance! I am very excited to be able to use my Kasa cameras inside of HA.

@Sammy1Am
Copy link
Author

What format are you using for your URL? (Obfuscate your real email and base64ed password of course) Mine looks like
kasa://sam%40example.com:aHVudGVyMg==@camera.example.com:19443/https/stream/mixed

@dubsaveli
Copy link

@Sammy1Am My URL looks like this:

kasa://username%40email.com:cGFzc3dvcmQ@cameraIPaddress:19443/https/stream/mixed

@AlexxIT
Copy link
Owner

AlexxIT commented Jun 18, 2024

@AlexxIT AlexxIT closed this as completed Jun 18, 2024
@asporykhin
Copy link

I've got a similar issue (tls: handshake failure) with dom.ru intercom cameras.

The error in the log is like this:

github.com/AlexxIT/go2rtc/internal/mjpeg/init.go:50 > error="streams: Get "https://cctv-sa1-dmfn.penza.vs.ertelecom.ru:18080/rtsp/xxxxxxxxxxx/xxxxxxxxxxxxxxxxxxxx\": remote error: tls: handshake failure, exec/rtsp\n[tls @ 0x7fd277a34ec0] error:0A00018A:SSL routines::dh key too small\n[in#0 @ 0x7fd27686ba80] Error opening input: I/O error\nError opening input file http://192.168.xx.xx:18000/stream?cameraID=xxxxxxxx.\nError opening input files: I/O error\n"

Uprgade to the latest v1.9.4 didn't help, so for now I rolled back to v1.8.1, which works fine.

@AlexxIT
Copy link
Owner

AlexxIT commented Jun 20, 2024

This fix works only for disabled TLS check. For example httpx or https + IP-address.
I think you getting redirect from http-address. So you can't use httpx.
You should create new issue. I don't know good solution yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants