Webrtc with secure sockets not working

Issues when playing with WebRTC Player

Re: Webrtc with secure sockets not working

Postby admin » Wed Jun 20, 2018 8:13 am

HTTP port 5119 secure = false with IP adress works
HTTP port 5119 secure = false with DNS A record does not work


So, it is NOT about secure sockets.

It is about IP address vs Domain name.

When you use mydomain.withcertificate.nl, neither unsecure nor secure sockets work!

Why are you hitting the NAT issue? AWS instance is not behind any NAT! Correct?
I am afraid, in your case, you will need to make the same fix as this user did in his case:
viewtopic.php?f=29&t=3552

Replace the candidate IP coming from the server to your public IP
admin
Site Admin
 
Posts: 944
Joined: Fri Aug 21, 2009 10:13 am

Re: Webrtc with secure sockets not working

Postby goes@tecnodes.nl » Wed Jun 20, 2018 10:29 am

Yes thanks to your suggestion I know it is a IP vs hostname issue.
If I am right it not a NAT issue but a public/private IP issue.

I may be a dumbhead but:
I thought the issue was fixed with a more generic fix in the new version of unrealwebrtcplayer.js? (Obviously there was a fix because unsecure with the old unrealwebrtcplayer.js did not work)
Is replacing the candidate IP gonna work with a DHCP private IP? The private IP of AWS EC2 is DHCP.
Is it not so that unrealwebrtcplayer.js must be altered to work also with hostnames.? I have not enough knowledge to do so.

Thanks for your time.
goes@tecnodes.nl
 
Posts: 0
Joined: Wed Nov 01, 2017 5:27 am

Re: Webrtc with secure sockets not working

Postby admin » Wed Jun 20, 2018 12:03 pm

The updated unrealwebrtcplayer.js fixes the NAT issue only if the IP address of media server is used;
it does NOT fix the NAT issue if hostname is used. The reason is - WebRTC does not support hostname for ICE candidate address, it must be the IP address.

In your case, it is probably NOT a NAT issue (AWS instance is not behind NAT...(?)), and of course, it is NOT a public/private IP issue.
It is rather an issue of very strange public IP resolved from your hostname (mydomain.withcertificate.nl) - that's not the public IP of your AWS instance machine. That's the problem.
What's the IP address in the returned candidate? Can you tell us? That will clarify things.

But, whatever it is, you need to solve the issue by yourself similar way the other user did:
http://www.umediaserver.net/phpBB3/view ... =29&t=3552

What you need to do:
In unrealwebrtcplayer.js, go to line 190, function EnsureValidCandidate
1. Modify line 191: remove the last condition from the if: "|| !ValidateIPaddress(ipAddress)", so the modified line is:
if ((candidate.search(ipAddress) !== -1) || !useSingleWebRTCPort || (ipAddress == "127.0.0.1")) {
2. Modify line 205: instead of
candLines[ipIndex] = ipAddress;
hardcode the server IP, the one that works when using unsecure socket, for example, "11.11.11.11":
candLines[ipIndex] = "11.11.11.11";
admin
Site Admin
 
Posts: 944
Joined: Fri Aug 21, 2009 10:13 am

Re: Webrtc with secure sockets not working

Postby goes@tecnodes.nl » Fri Jun 22, 2018 8:39 am

I missed the email about you latest reply. Thats delayed my response, sorry.

I hardcoded the external server IP, but thats does not change anything. Both secure and unsecure stream does not work with a hostname same error: alert "Connection failed; playback stopped"
I doubble chequed the hardcoded IP adress and tested it with unsecure and IP adress as parameters. Then it streams.

I you wish I can provide you the real hostname and Ip adress.
goes@tecnodes.nl
 
Posts: 0
Joined: Wed Nov 01, 2017 5:27 am

Re: Webrtc with secure sockets not working

Postby admin » Fri Jun 22, 2018 9:25 am

Yes please write all the details to
techsupport@umediaserver.net
admin
Site Admin
 
Posts: 944
Joined: Fri Aug 21, 2009 10:13 am

Re: Webrtc with secure sockets not working

Postby goes@tecnodes.nl » Fri Jun 22, 2018 3:22 pm

The hardcoded server external IP works now.
Thanks a lot for the support!!

It is amazing how quick it is streaming after pageload!
goes@tecnodes.nl
 
Posts: 0
Joined: Wed Nov 01, 2017 5:27 am

Re: Webrtc with secure sockets not working

Postby admin » Fri Jun 22, 2018 3:41 pm

Yes, let me summarize so other users can learn:

This appears to be a NAT issue: the server is hosted on AWS instance with elastic IP address.
So it appears that AWS uses NAT for elastic IP addresses; when you send a request to elastic IP address, it gets forwarded to your instance's local IP address, i.e. 172.x.x.x

So, when your server is behind NAT, and you are specifying domain name (hostname) of the server on the webpage (for secure websocket using domain name is a must)
then you must apply the fix suggested above.
admin
Site Admin
 
Posts: 944
Joined: Fri Aug 21, 2009 10:13 am

Previous

Return to Playing with WebRTC Player

Who is online

Users browsing this forum: No registered users and 1 guest

cron