Skip to content

Commit c692ea0

Browse files
authored
FF138 Relnote: Certificate returns fingerprints (mdn#39010)
1 parent f88d6ef commit c692ea0

File tree

2 files changed

+40
-10
lines changed
  • files/en-us
    • mozilla/firefox/releases/138
    • web/api/rtccertificate/getfingerprints

2 files changed

+40
-10
lines changed

files/en-us/mozilla/firefox/releases/138/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ Firefox 138 is the current [Beta version of Firefox](https://www.mozilla.org/en-
5656
([Firefox bug 1945576](https://bugzil.la/1945576) and [Firefox bug 1945573](https://bugzil.la/1945573)).
5757
- The [Web Audio API](/en-US/docs/Web/API/Web_Audio_API) now supports bidirectional messaging on an {{domxref("AudioWorklet.port")}} and an {{domxref("AudioWorkletGlobalScope.port")}}.
5858
This allows for custom, asynchronous communication between code in the main thread and the global scope of an audio worklet, such as receiving control data or global settings. ([Firefox bug 1951240](https://bugzil.la/1951240))
59+
- The {{domxref("RTCCertificate.getFingerprints()","getFingerprints()")}} method of the {{domxref("RTCCertificate")}} interface is now supported.
60+
An application can use this to get fingerprints for a certificate, which might be shared out-of-band in order to identify a particular user or browser across WebRTC sessions.
61+
([Firefox bug 1525241](https://bugzil.la/1525241)).
5962

6063
#### DOM
6164

files/en-us/web/api/rtccertificate/getfingerprints/index.md

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ browser-compat: api.RTCCertificate.getFingerprints
1010

1111
The **`getFingerprints()`** method of the **{{domxref("RTCCertificate")}}** interface is used to get an array of certificate fingerprints.
1212

13-
An application can use this method to compare the client certificate fingerprints with the certificate fingerprints from the server.
14-
The server and client may support different sets of algorithms: all fingerprint values for the set of algorithms supported by both client and server should match.
13+
This can be used in application-level code to get certificate fingerprints, which are {{glossary("hash function","hashes")}} of the certificate created using the various algorithms supported by the browser.
1514

1615
## Syntax
1716

@@ -35,28 +34,56 @@ Each fingerprint is represented by an object with the following properties:
3534
- : A string containing the certificate fingerprint in lowercase hex string, as calculated with the `algorithm` hash function.
3635
The format is more precisely defined in [RFC4572, Section 5](https://www.rfc-editor.org/rfc/rfc4572#section-5).
3736

37+
## Description
38+
39+
The {{domxref("RTCCertificate")}} instances used for a particular {{DOMxRef("RTCPeerConnection")}} can created using the {{DOMxRef("RTCPeerConnection.generateCertificate_static", "RTCPeerConnection.generateCertificate()")}} static method or fetched from storage in an [IndexedDB](/en-US/docs/Web/API/IndexedDB_API), and set in the constructor.
40+
If no certificates are passed in the constructor they will be created automatically, in which case the certificates used can be fetched with {{DOMxRef("RTCPeerConnection.getConfiguration()")}}.
41+
42+
Browsers will automatically exchange certificates and fingerprints associated with each {{DOMxRef("RTCPeerConnection")}} during the SDP offer phase, and these will be used as part of the DTLS handshake to verify that the remote party matches the certificate/endpoint send in the SDP.
43+
This provides a low level validation that the WebRTC communication is being set up with the remote party that initiated the offer, but does not, for example, provide any validation of the identity of the communicating users.
44+
45+
In some cases it can be useful for the application layer to share certificate fingerprints out-of-band:
46+
47+
- If a trust relationship has been established between two web-browsers it can be persisted by storing the certificates and reusing them in a later session (up to a year later).
48+
The trusted certificates are identified by their fingerprints.
49+
- Peers than want to identify a particular user can send fingerprints and validate the associated user "out of band" (i.e., outside of the browser-mediated WebRTC communications flow).
50+
The application can use the fingerprint to identify later sessions with the specific user.
51+
- In some conferencing server ("middlebox") implementations, the server may need to known the fingerprints before doing any offer/answer.
52+
53+
Peers may support different sets of algorithms.
54+
When comparing certificates, all fingerprint values for the set of algorithms supported by peers should match.
55+
3856
## Examples
3957

4058
### Getting certificate fingerprints
4159

42-
This example shows how you might get certificate fingerprints and compare them to fingerprints from a server.
60+
This example shows how you might get certificate fingerprints from the local peer and compare them to fingerprints from the remote peer.
4361

44-
First we create a connection and get the fingerprints.
45-
We also get the fingerprints from the server using "some mechanism".
62+
First we create a connection and get certificates and their fingerprints.
63+
We get the fingerprints from the remote peer using "some out of band mechanism".
4664

4765
```js
66+
// Get the certificate fingerprints from the local peer.
4867
const rtcPeerConnection = new RTCPeerConnection();
68+
const configuration = rtcPeerConnection.getConfiguration();
69+
const certificates = configuration.certificates;
70+
let fingerprintsFromClient;
71+
72+
if (certificates && certificates.length > 0) {
73+
certificates.forEach((cert) => {
74+
// For purpose of demonstration, just get first certificate
75+
fingerprintsFromClient = cert.getFingerprints();
76+
break;
77+
});
78+
}
4979

50-
// Get the certificate fingerprints from the client.
51-
const fingerprintsFromClient = rtcPeerConnection.certificate.getFingerprints();
52-
53-
// Get the certificate fingerprints from the server (pseudo code)
80+
// Get the certificate fingerprints from the remote peer for particular certificate (pseudo code)
5481
const fingerprintsFromServer = [
5582
/**/
5683
];
5784
```
5885

59-
There are numerous ways to compare the fingerprint arrays.
86+
There are numerous ways to compare the fingerprint arrays for a particular certificate.
6087
Here we convert the arrays to dictionary objects where the algorithm name is the property and then compare them.
6188
This works because only one fingerprint value can exist for each algorithm.
6289
(There are many other ways to sort and compare the two arrays).

0 commit comments

Comments
 (0)