Skip to content

fix(whip): support https endpoints with Bearer auth#2121

Open
andoodle wants to merge 1 commit into
pedroSG94:masterfrom
andoodle:fix/whip-https
Open

fix(whip): support https endpoints with Bearer auth#2121
andoodle wants to merge 1 commit into
pedroSG94:masterfrom
andoodle:fix/whip-https

Conversation

@andoodle

Copy link
Copy Markdown

WhipClient can't publish to https WHIP servers:

  • validSchemes only allows "http", so an https:// URL is rejected with "Endpoint malformed".
  • setAuthorization is an unimplemented TODO() that crashes any caller.
  • the signaling request hardcodes http:// and POSTs to only the appName path segment, using the last path segment as the token. Standard WHIP servers expect a POST to the full endpoint URL with an Authorization: Bearer token.

Changes

  • accept "https" in validSchemes
  • build the signaling POST from the parsed scheme (https over TLS) and the full endpoint path
  • implement setAuthorization to carry the Bearer token (mapped from the shared user/password API)

Tested against a standard https WHIP ingest (Dolby/Millicast): the publish is accepted (201 + ICE) where it was previously rejected with "Endpoint malformed".

WhipClient could not publish to https WHIP servers:
- validSchemes only allowed "http", so an https URL was rejected with
  "Endpoint malformed".
- setAuthorization was an unimplemented TODO() that crashed any caller.
- the signaling request hardcoded http:// and POSTed to only the appName
  path segment, using the last path segment as the token. Standard WHIP
  servers expect a POST to the full endpoint URL with an Authorization:
  Bearer token.

Changes:
- accept "https" in validSchemes.
- build the signaling POST from the parsed scheme (https over TLS) and the
  full endpoint path.
- implement setAuthorization to carry the Bearer token (mapped from the
  shared user/password API).

Tested against a standard https WHIP ingest (Dolby/Millicast): the publish
is accepted (201 + ICE) where it was previously rejected.
@pedroSG94

Copy link
Copy Markdown
Owner

Hello,

Thank you for the auth implementation.
I did a minimal code refactor to the PR to keep coherency with other protocols here:
#2122

Can you test it and confirm me that all is fine? After that, I will merge it

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

Successfully merging this pull request may close these issues.

2 participants