Skip to content

Add basic certificate/fingerprint control. - #99

Merged
pthatcher merged 2 commits into
w3c:mainfrom
Philipel-WebRTC:basic-encryption
Apr 21, 2026
Merged

Add basic certificate/fingerprint control.#99
pthatcher merged 2 commits into
w3c:mainfrom
Philipel-WebRTC:basic-encryption

Conversation

@Philipel-WebRTC

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread api-outline.md Outdated
// we not set the fingerprint of all the peers certificates?
void setPeerFingerprint(DOMString fingerprint);

// After a viable CandidatePair has been found (by using probePath) then a

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably specify when the promise resolves.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread api-outline.md Outdated
// After a viable CandidatePair has been found (by using probePath) then a
// successful handshake needs to be performed before `sendPackets` can be
// used.
promise<void> establishEncryption(CandidatePair candidatePair);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Promise should be capitalized.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread api-outline.md Outdated
// Set the fingerprint of the certificate of the peer.
// TODO: The transport can be configured with multiple certificates, should
// we not set the fingerprint of all the peers certificates?
void setPeerFingerprint(DOMString fingerprint);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be called setRemoteFingerprint.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or just pass in the fingerprint into the establishEncryption method.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to send ClientHello with STUN pings I think this would need to be a separate function.

Comment thread api-outline.md Outdated

// Set the fingerprint of the certificate of the peer.
// TODO: The transport can be configured with multiple certificates, should
// we not set the fingerprint of all the peers certificates?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fingerprint should be a byte array, not a string.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread api-outline.md Outdated
void setFormat(DOMString wireFormat);

// Set the fingerprint of the certificate of the peer.
// TODO: The transport can be configured with multiple certificates, should

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should probably allow providing multiple.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread api-outline.md Outdated
// A name could be useful for debugging/devtools.
DOMString name;
// Certificates?
sequence<RTCCertificate> certificates;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the actual handshake use more than one certificate? I thought, at least with DTLS, it had to pick one. But maybe I'm wrong.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the reason we use multiple certificates:
https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection#certificates
https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection#using_certificates

I guess it's a good way to future proof the API, if some new algorithm becomes recommended then this would help us migrate to it.

@pthatcher
pthatcher merged commit a0a6c6f into w3c:main Apr 21, 2026
1 of 2 checks passed
@Philipel-WebRTC
Philipel-WebRTC deleted the basic-encryption branch May 26, 2026 08:11
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