// We don't normally allow localhost channels to be proxied, but this // is easier than updating all the certs and/or domains.
Services.prefs.setBoolPref("network.proxy.allow_hijacking_localhost", true);
registerCleanupFunction(() => {
Services.prefs.clearUserPref("network.proxy.allow_hijacking_localhost");
});
var concurrent_channels = [];
var loadGroup; var serverPort; var proxy;
add_setup(async function setup() {
serverPort = Services.env.get("MOZHTTP2_PORT"); Assert.notEqual(serverPort, null);
dump("using port " + serverPort + "\n");
// Set to allow the cert presented by our H2 server
do_get_profile();
Services.prefs.setIntPref("network.http.speculative-parallel-limit", 0);
// The moz-http2 cert is for foo.example.com and is signed by http2-ca.pem // so add that cert to the trust list as a signing cert. Some older tests in // this suite use localhost with a TOFU exception, but new ones should use // foo.example.com
let certdb = Cc["@mozilla.org/security/x509certdb;1"].getService(
Ci.nsIX509CertDB
);
addCertFromFile(certdb, "http2-ca.pem", "CTu,u,u");
addCertFromFile(certdb, "proxy-ca.pem", "CTu,u,u");
// hack - the header test resets the multiplex object on the server, // so make sure header is always run before the multiplex test. // // make sure post_big runs first to test race condition in restarting // a stalled stream when a SETTINGS frame arrives
add_task(async function do_test_http2_post_big() { const { httpProxyConnectResponseCode } =
await test_http2_post_big(serverPort); Assert.equal(httpProxyConnectResponseCode, 200);
});
add_task(async function do_test_http2_h11required_stream() { // Add new tests above here - best to add new tests before h1 // streams get too involved // These next two must always come in this order const { httpProxyConnectResponseCode } =
await test_http2_h11required_stream(serverPort); Assert.equal(httpProxyConnectResponseCode, 200);
});
add_task(async function do_test_http2_wrongsuite_tls12() { // For this test we need to start HTTPS 1.1 proxy because HTTP/2 proxy cannot be used.
proxy.unregisterFilter();
let proxyHttp1 = new NodeHTTPSProxyServer();
await proxyHttp1.start();
proxyHttp1.registerFilter();
registerCleanupFunction(() => {
proxyHttp1.stop();
}); const { httpProxyConnectResponseCode } =
await test_http2_wrongsuite_tls12(serverPort); Assert.equal(httpProxyConnectResponseCode, 200);
proxyHttp1.unregisterFilter();
proxy.registerFilter();
});
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.