mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-25 09:57:32 +09:00
Issue #1991 - Support TURN TLS Support in WebRTC Backport of Mozilla bug 1056934
This commit is contained in:
parent
1270657ba0
commit
2dc4713d14
16 changed files with 282 additions and 26 deletions
|
|
@ -1822,6 +1822,33 @@ function createHTML(options) {
|
|||
var iceServerWebsocket;
|
||||
var iceServersArray = [];
|
||||
|
||||
var addTurnsSelfsignedCerts = () => {
|
||||
var gUrl = SimpleTest.getTestFileURL('addTurnsSelfsignedCert.js');
|
||||
var gScript = SpecialPowers.loadChromeScript(gUrl);
|
||||
var certs = [];
|
||||
// If the ICE server is running TURNS, and includes a "cert" attribute in
|
||||
// its JSON, we set up an override that will forgive things like
|
||||
// self-signed for it.
|
||||
iceServersArray.forEach(iceServer => {
|
||||
if (iceServer.hasOwnProperty("cert")) {
|
||||
iceServer.urls.forEach(url => {
|
||||
if (url.startsWith("turns:")) {
|
||||
// Assumes no port or params!
|
||||
certs.push({"cert": iceServer.cert, "hostname": url.substr(6)});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
gScript.addMessageListener('certs-added', () => {
|
||||
resolve();
|
||||
});
|
||||
|
||||
gScript.sendAsyncMessage('add-turns-certs', certs);
|
||||
});
|
||||
};
|
||||
|
||||
var setupIceServerConfig = useIceServer => {
|
||||
// We disable ICE support for HTTP proxy when using a TURN server, because
|
||||
// mochitest uses a fake HTTP proxy to serve content, which will eat our STUN
|
||||
|
|
@ -1863,7 +1890,8 @@ var setupIceServerConfig = useIceServer => {
|
|||
|
||||
return enableHttpProxy(false)
|
||||
.then(spawnIceServer)
|
||||
.then(iceServersStr => { iceServersArray = JSON.parse(iceServersStr); });
|
||||
.then(iceServersStr => { iceServersArray = JSON.parse(iceServersStr); })
|
||||
.then(addTurnsSelfsignedCerts);
|
||||
};
|
||||
|
||||
function runNetworkTest(testFunction, fixtureOptions) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue