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

Secure TURN cert error #5

Open
Megzo opened this issue Nov 2, 2024 · 0 comments
Open

Secure TURN cert error #5

Megzo opened this issue Nov 2, 2024 · 0 comments

Comments

@Megzo
Copy link

Megzo commented Nov 2, 2024

When using the auth service, the returning json contains the IP address of the LoadBalancer service of the Stunner gateway (sometimes the LoadBalancer address is a cloud provider specific hostname, but this problem occurs nevertheless).
E.g. curl <auth service address:port>/ice?service=turn results in the following json:

{"iceServers":[{"credential":"xxx","urls":["turn:149.102.144.152:3478?transport=udp","turn:149.102.144.152:3478?transport=tcp","turns:149.102.144.152:5349?transport=tcp","turns:149.102.144.152:5349?transport=udp"],"username":"yyy"}],"iceTransportPolicy":"all"}

In this case the normal turn endpoins work just as fine, but the secure turns endpoints will result in an invalid certification error, since the client will use the IP address as the SNI field for which the TLS cert is not valid. We need to return a valid hostname for turns listeners which is the same as the Common Name (CN) filed of the TLS cert which Stunner uses for the secure listeners.

There are two alternative solutions in my mind:
1: use an ENV variable to config the turns hostnames, and the Auth Service would just use this insted of the raw IP addresses (this is a quick and easy solution, but the users would need to manually add the hostname)
2: the Auth Service could read the same secrets as Stunner uses for the secure listeners, extract the CN and use that in the answer (this would be automatic for users, but might result in errors: e.g. the cert has a wildcard domain, and we don't know which subdomain routes to Stunner)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant