A free, open-source alternative to Burp Suite: an intercepting proxy and web app security testing suite with Repeater, Intruder, Collaborator and a built-in OWASP ZAP scanner. Linux, AGPL-3.0.
Java application-securityappsecbug-bountyburp-alternativeburp-suitedasthttp-proxyinfosecintercepting-proxyjavaowaspowasp-zappenetration-testingpentestingsecuritysecurity-toolsvulnerability-scannerweb-application-securityweb-security
package opensuite.ui.settings;
import opensuite.core.Settings;
import opensuite.core.SuiteContext;
import opensuite.ui.OptionsPage;
import opensuite.ui.Ui;
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Dimension;
/** Settings > Network pages: Connections, DNS, TLS, HTTP. */
public final class NetworkPages {
private NetworkPages() {}
public static SettingsPage connections(SuiteContext ctx) {
Settings s = ctx.settings();
SettingsPage p = new SettingsPage();
p.block("Platform authentication", SettingsPage.Kind.BOTH,
"You can configure Open Suite to carry out platform authentication to destination web servers automatically (Basic, NTLM, Digest). Use these settings to manage your platform authentication credentials, per destination host.",
() -> { s.setBool("auth.platform", true); s.set("auth.platform.rows", ""); s.setBool("auth.prompt", false); },
SettingsPage.overrideRow(s, "auth.overrideProject"),
SettingsPage.check(s, "auth.platform", true, "Do platform authentication"),
opensuite.ui.Sections.gap(5),
new KeyedTable(s, "auth.platform.rows", new String[]{"Enabled", "Destination host", "Type", "Username", "Password", "Domain", "Domain hostname"}, 150)
.hide("Password").choices("Type", "Basic", "NTLMv2", "Digest").size(510, 150).buttons(87, 32, 10).widths(60, 149, 72, 60, 60, 109),
opensuite.ui.Sections.gap(5),
SettingsPage.check(s, "auth.prompt", false, "Prompt for credentials on platform authentication failure"));
p.block("Timeouts", SettingsPage.Kind.PROJECT,
"Use these settings to specify the timeouts to be used for various network tasks. Values are in seconds. If an option is set to zero or left blank, then that function will never time out.",
() -> { s.setInt("timeout.connect", 120); s.setInt("timeout.read", 120); s.setInt("timeout.openEnded", 10); s.setInt("timeout.dns", 300); s.setInt("timeout.dnsFailed", 60); },
OptionsPage.fieldRow("Connect:", SettingsPage.number(s, "timeout.connect", 120, 6), ""),
OptionsPage.fieldRow("Normal:", SettingsPage.number(s, "timeout.read", 120, 6), ""),
OptionsPage.fieldRow("Open-ended responses:", SettingsPage.number(s, "timeout.openEnded", 10, 6), ""),
OptionsPage.fieldRow("Domain name resolution:", SettingsPage.number(s, "timeout.dns", 300, 6), ""),
OptionsPage.fieldRow("Failed domain name resolution:", SettingsPage.number(s, "timeout.dnsFailed", 60, 6), ""));
p.block("Upstream proxy servers", SettingsPage.Kind.BOTH,
"Use these settings to control whether Open Suite sends outgoing requests to an upstream proxy server, or directly to the destination web server. "
+ "The first rule that matches each destination host is used. To send all traffic to a single proxy server, create a rule with * as the destination host.",
null,
SettingsPage.overrideRow(s, "upstream.overrideProject"),
new opensuite.proxy.UpstreamProxyPanel(ctx));
// A small switch with its label, as the reference sets this one option.
opensuite.ui.SmallSwitch socksSwitch = new opensuite.ui.SmallSwitch(s.getBool("socks.enabled", false));
socksSwitch.setOnToggle(() -> s.setBool("socks.enabled", socksSwitch.isOn()));
s.addListener(k -> { if (k.equals("socks.enabled")) SwingUtilities.invokeLater(() -> socksSwitch.setOn(s.getBool("socks.enabled", false))); });
JLabel socksLabel = opensuite.ui.Sections.caption("Use SOCKS proxy");
socksLabel.addMouseListener(new java.awt.event.MouseAdapter() {
@Override public void mousePressed(java.awt.event.MouseEvent e) { socksSwitch.dispatchEvent(SwingUtilities.convertMouseEvent(socksLabel, e, socksSwitch)); }
});
JPanel useSocks = SettingsPage.line(20, 2, socksSwitch, 6, socksLabel);
JLabel socksStatus = Ui.label(s.get("socks.host", "").isEmpty() ? "No proxy configured." : "SOCKS proxy: " + s.get("socks.host", "") + ":" + s.get("socks.port", "1080"));
JButton configure = Ui.button("Configure", "set the SOCKS proxy host, port and credentials");
configure.addActionListener(e -> {
JTextField host = Ui.field(s.get("socks.host", "")), port = Ui.shortField(s.get("socks.port", "1080")), user = Ui.field(s.get("socks.user", ""));
JPasswordField pass = Ui.passwordField(s.get("socks.password", ""));
pass.setFont(Ui.PLAIN);
JCheckBox dns = Ui.check("Do DNS lookups over SOCKS proxy", s.getBool("socks.dns", true));
JPanel form = Ui.vbox(Ui.form("Host:", host, "Port:", port, "Username:", user, "Password:", pass), dns);
form.setBorder(Ui.pad(10, 10, 10, 10));
if (JOptionPane.showConfirmDialog(configure, form, "SOCKS proxy", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) != JOptionPane.OK_OPTION) return;
s.set("socks.host", host.getText().strip()); s.set("socks.port", port.getText().strip()); s.set("socks.user", user.getText().strip());
s.set("socks.password", new String(pass.getPassword())); s.setBool("socks.dns", dns.isSelected());
socksStatus.setText(host.getText().isBlank() ? "No proxy configured." : "SOCKS proxy: " + host.getText().strip() + ":" + port.getText().strip());
});
Ui.sized(configure, 98);
int in = 22 + 3 * Ui.fontGrowth(); // what belongs to the switch stands in from it
p.block("SOCKS proxy", SettingsPage.Kind.BOTH,
"Use these settings to configure Open Suite to use a SOCKS proxy for all outgoing communications. This setting is applied at the TCP level, "
+ "and all outbound requests will be sent via this proxy. If you have configured rules for upstream HTTP proxy servers, then requests to "
+ "upstream proxies will be sent via the SOCKS proxy configured here.",
() -> SettingsPage.clearPrefix(s, "socks."),
SettingsPage.overrideRow(s, "socks.overrideProject"),
useSocks, opensuite.ui.Sections.gap(0),
OptionsPage.indent(socksStatus, in), opensuite.ui.Sections.gap(2),
OptionsPage.indent(configure, in), opensuite.ui.Sections.gap(3),
OptionsPage.indent(opensuite.ui.Sections.caption("If you want certain hosts to bypass the SOCKS proxy, specify them here."), in),
opensuite.ui.Sections.fill(hostList(s, "socks.bypass", in)));
return p;
}
/**
* A plain list of hosts kept one to a line under {@code key}: Paste, Load, Remove
* and Clear beside a box without a header, and Add with its field beneath.
*/
private static JPanel hostList(Settings s, String key, int indent) {
DefaultListModel<String> model = new DefaultListModel<>();
for (String line : s.get(key, "").split("\n")) {
String h = line.split("\t", -1)[0].strip();
if (!h.isEmpty()) model.addElement(h);
}
Runnable store = () -> {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < model.size(); i++) sb.append(model.get(i)).append('\n');
s.set(key, sb.toString());
};
java.util.function.Consumer<String> addAll = text -> {
for (String line : text.split("\\R")) {
String h = line.strip();
if (!h.isEmpty() && !model.contains(h)) model.addElement(h);
}
store.run();
};
JList<String> list = new JList<>(model);
list.setFont(Ui.PLAIN);
JTextField entry = Ui.field("");
entry.putClientProperty("JTextField.placeholderText", "Enter a new item");
entry.putClientProperty(Ui.ITALIC_PLACEHOLDER, Boolean.TRUE);
JButton paste = Ui.button("Paste"), load = Ui.button("Load..."), remove = Ui.button("Remove"), clear = Ui.button("Clear"), add = Ui.button("Add");
paste.addActionListener(e -> {
try { addAll.accept((String) java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().getData(java.awt.datatransfer.DataFlavor.stringFlavor)); }
catch (Exception ignored) { }
});
load.addActionListener(e -> {
JFileChooser fc = new opensuite.ui.FileChooser();
if (fc.showOpenDialog(list) != JFileChooser.APPROVE_OPTION) return;
try { addAll.accept(java.nio.file.Files.readString(fc.getSelectedFile().toPath())); }
catch (Exception ex) { JOptionPane.showMessageDialog(list, "The file could not be read: " + ex.getMessage(), "Load", JOptionPane.ERROR_MESSAGE); }
});
remove.addActionListener(e -> {
int[] sel = list.getSelectedIndices();
for (int i = sel.length - 1; i >= 0; i--) model.remove(sel[i]);
store.run();
});
clear.addActionListener(e -> { model.clear(); store.run(); });
java.awt.event.ActionListener addEntry = e -> { addAll.accept(entry.getText()); entry.setText(""); };
add.addActionListener(addEntry);
entry.addActionListener(addEntry);
Dimension button = new Dimension(Ui.buttonBlock(1).width, Ui.tall(22));
for (JButton b : new JButton[] { paste, load, remove, clear, add }) b.setPreferredSize(button);
JScrollPane box = Ui.scroll(list);
box.setPreferredSize(new Dimension(200, 150));
JPanel top = new JPanel(new BorderLayout(5, 0));
top.setOpaque(false);
top.add(Ui.buttonColumn(paste, load, remove, clear), BorderLayout.WEST);
top.add(box, BorderLayout.CENTER);
JPanel bottom = new JPanel(new BorderLayout(5, 0));
bottom.setOpaque(false);
bottom.add(add, BorderLayout.WEST);
bottom.add(entry, BorderLayout.CENTER);
JPanel all = new JPanel(new BorderLayout(0, 5));
all.setOpaque(false);
all.setBorder(Ui.pad(0, indent, 0, 0));
all.add(top, BorderLayout.CENTER);
all.add(bottom, BorderLayout.SOUTH);
return all;
}
public static SettingsPage dns(SuiteContext ctx) {
Settings s = ctx.settings();
SettingsPage p = new SettingsPage();
JRadioButton[] r = SettingsPage.radios(s, "dns.mode", "system", new String[]{"system", "ipv4", "ipv6"},
"Use system's default behavior", "Prefer IPv4", "Prefer IPv6");
p.block("Preferred IP version for DNS resolution", SettingsPage.Kind.PROJECT,
"Use this setting to choose how Open Suite prioritizes IP addresses during DNS lookups.",
() -> { s.set("dns.mode", "system"); r[0].setSelected(true); }, r[0], r[1], r[2]);
p.block("Hostname resolution overrides", SettingsPage.Kind.PROJECT,
"Use these settings to specify mappings of hostnames to IP addresses.",
null, new KeyedTable(s, "dns.overrides", new String[]{"Enabled", "Hostname", "IP address"}, 150)
.size(360, 150).widths(60, 149, 150));
return p;
}
public static SettingsPage tls(SuiteContext ctx) {
Settings s = ctx.settings();
SettingsPage p = new SettingsPage();
JRadioButton[] r = SettingsPage.radios(s, "tls.protocols", "all", new String[]{"all", "default", "custom"},
"Use all supported protocols and ciphers of your Java installation",
"Use the default protocols and ciphers of your Java installation",
"Use custom protocols and ciphers");
// The custom lists show only while they are the ones in use.
JPanel custom = customTls(s);
// The holder is always there and has no height while they are hidden, so the rows below keep their place.
JPanel customHolder = new JPanel(new BorderLayout()) {
@Override public Dimension getPreferredSize() {
return custom.isVisible() ? super.getPreferredSize() : new Dimension(0, 0);
}
};
customHolder.setOpaque(false);
customHolder.add(custom, BorderLayout.CENTER);
Runnable showCustom = () -> { custom.setVisible(r[2].isSelected()); customHolder.revalidate(); };
for (JRadioButton b : r) b.addItemListener(e -> showCustom.run());
showCustom.run();
p.block("TLS negotiation", SettingsPage.Kind.PROJECT,
"Use these settings to control the TLS protocols and ciphers that Open Suite uses when performing TLS negotiation with upstream "
+ "servers. Use these settings with caution, as misconfiguration may break your outgoing TLS connections.",
() -> { SettingsPage.clearPrefix(s, "tls."); r[0].setSelected(true); },
opensuite.ui.Sections.caption("TLS trust"),
SettingsPage.check(s, "tls.verifyUpstream", false, "Verify upstream TLS"),
opensuite.ui.Sections.gap(5),
r[0], r[1], r[2],
customHolder,
opensuite.ui.Sections.gap(5),
opensuite.ui.Sections.caption("TLS negotiation workarounds"),
SettingsPage.check(s, "tls.unsafeRenegotiation", false, "Allow unsafe renegotiation (required for some client certificates)"),
SettingsPage.check(s, "tls.noSessionResume", false, "Disable TLS session resume"));
KeyedTable clientCerts = new KeyedTable(s, "tls.client.rows",
new String[]{"Enabled", "Host", "Type", "Alias", "Subject", "Issuer", "Intermediate CA", "Key", "File", "Password"}, 150, "Add", "Remove", "Up", "Down")
.hide("File").hide("Password").size(672, 150).widths(48, 96, 36, 72, 119, 120, 119, 61);
clientCerts.adder(() -> addClientCertificate(clientCerts));
p.block("Client TLS certificates", SettingsPage.Kind.BOTH,
"Use these settings to configure the client TLS certificates that Open Suite will use when a destination host requests one. You can "
+ "configure multiple certificates, and specify the hosts for which each certificate should be used. When a host requests a client "
+ "TLS certificate, Open Suite uses the first certificate in the list whose host configuration matches the name of the host being contacted.",
null,
SettingsPage.overrideRow(s, "tls.client.overrideProject"),
clientCerts);
KeyedTable serverCerts = new KeyedTable(s, "tls.server.rows", new String[]{"Host", "Name", "Issuer", "Certificate"}, 150)
.hide("Certificate").size(540, 150).widths(150, 190, 198);
serverCerts.onOpen(row -> showCertificate(serverCerts, row.length > 3 ? row[3] : ""));
p.restoreMark().block("Server TLS certificates", SettingsPage.Kind.PROJECT,
"This panel shows a list of the unique TLS certificates received from web servers. Double-click an item to show the full details of the certificate.",
() -> { s.remove("tls.server.rows"); serverCerts.reload(); },
serverCerts);
KeyedTable caCerts = new KeyedTable(s, "tls.ca.rows", new String[]{"Name", "File"}, 150, "Add", "Remove").hide("File").size(360, 150);
caCerts.adder(() -> {
JFileChooser fc = new opensuite.ui.FileChooser();
fc.setDialogTitle("CA certificate (PEM or DER)");
if (fc.showOpenDialog(caCerts) != JFileChooser.APPROVE_OPTION) return null;
java.io.File f = fc.getSelectedFile();
try (java.io.InputStream in = new java.io.FileInputStream(f)) {
java.security.cert.X509Certificate x = (java.security.cert.X509Certificate)
java.security.cert.CertificateFactory.getInstance("X.509").generateCertificate(in);
return new String[] { opensuite.core.NetworkConfig.commonName(x.getSubjectX500Principal().getName()), f.getAbsolutePath() };
} catch (Exception ex) {
JOptionPane.showMessageDialog(caCerts, "The file is not a certificate: " + ex.getMessage(), "Custom CA certificates", JOptionPane.ERROR_MESSAGE);
return null;
}
});
p.block("Custom CA certificates", SettingsPage.Kind.USER,
"Additional certificate authorities to trust when verifying upstream TLS.",
null, caCerts);
p.block("Java TLS settings", SettingsPage.Kind.USER,
"Low-level settings for the Java runtime TLS stack. Both require a restart to take effect.",
() -> { s.setBool("tls.java.unblockAlgorithms", true); s.setBool("tls.java.disableSni", false); },
SettingsPage.check(s, "tls.java.unblockAlgorithms", true, "Enable algorithms blocked by Java security policy (requires restart)"),
SettingsPage.check(s, "tls.java.disableSni", false, "Disable Java SNI extension (requires restart)"));
return p;
}
/** The protocol and cipher lists of "Use custom protocols and ciphers": a tick for each one in use. */
private static JPanel customTls(Settings s) {
String[][] supported = opensuite.core.NetworkConfig.supported();
JPanel p = new JPanel();
p.setLayout(new BoxLayout(p, BoxLayout.X_AXIS));
p.setOpaque(false);
p.setBorder(Ui.pad(4, 22, 0, 0));
String[] keys = { "tls.custom.protocols", "tls.custom.ciphers" }, heads = { "Protocol", "Cipher" };
int[] widths = { 200, 430 };
for (int k = 0; k < 2; k++) {
final String key = keys[k];
final String[] names = supported[k];
// Nothing chosen yet means everything: the list starts from what "all" would use.
java.util.Set<String> chosen = new java.util.LinkedHashSet<>();
String saved = s.get(key, "");
if (saved.isBlank()) chosen.addAll(java.util.Arrays.asList(names));
else for (String n : saved.split(",")) chosen.add(n.trim());
final boolean[] on = new boolean[names.length];
for (int i = 0; i < names.length; i++) on[i] = chosen.contains(names[i]);
final String head = heads[k];
javax.swing.table.AbstractTableModel m = new javax.swing.table.AbstractTableModel() {
public int getRowCount() { return names.length; }
public int getColumnCount() { return 2; }
public String getColumnName(int c) { return c == 0 ? "Enabled" : head; }
public Class<?> getColumnClass(int c) { return c == 0 ? Boolean.class : String.class; }
public boolean isCellEditable(int r, int c) { return c == 0; }
public Object getValueAt(int r, int c) { return c == 0 ? (Object) on[r] : names[r]; }
public void setValueAt(Object v, int r, int c) {
on[r] = Boolean.TRUE.equals(v);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < names.length; i++) if (on[i]) sb.append(sb.length() > 0 ? "," : "").append(names[i]);
s.set(key, sb.toString());
}
};
JTable t = new JTable(m);
Ui.styleTable(t);
Ui.exactWidths(t, 60, widths[k] - 62);
JScrollPane sp = Ui.scroll(t);
sp.setPreferredSize(new Dimension(widths[k], 150));
sp.setMaximumSize(new Dimension(widths[k], 150));
p.add(sp);
if (k == 0) p.add(Box.createHorizontalStrut(10));
}
p.add(Box.createHorizontalGlue());
return p;
}
/** Ask for a PKCS#12 file, its password and the host it is for, and read the certificate out of it. */
private static String[] addClientCertificate(JComponent parent) {
JTextField host = Ui.field("", 24), file = Ui.field("", 24);
JPasswordField password = Ui.passwordField("");
password.setFont(Ui.PLAIN);
JButton pick = Ui.button("Select file ...");
pick.addActionListener(e -> {
JFileChooser fc = new opensuite.ui.FileChooser();
fc.setFileFilter(new javax.swing.filechooser.FileNameExtensionFilter("PKCS#12 (*.p12, *.pfx)", "p12", "pfx"));
if (fc.showOpenDialog(pick) == JFileChooser.APPROVE_OPTION) file.setText(fc.getSelectedFile().getAbsolutePath());
});
JPanel form = Ui.vbox(Ui.label("Destination host (leave blank for any host; * matches any sequence of characters):"), host,
Box.createVerticalStrut(8), Ui.label("Certificate file (PKCS#12):"), Ui.row(file, pick),
Box.createVerticalStrut(8), Ui.label("Password:"), password);
form.setBorder(Ui.pad(10, 10, 10, 10));
while (true) {
if (JOptionPane.showConfirmDialog(parent, form, "Client TLS certificate", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) != JOptionPane.OK_OPTION) return null;
String pw = new String(password.getPassword());
try {
String[] d = opensuite.core.NetworkConfig.describeClientCertificate(file.getText().strip(), pw);
return new String[] { "true", host.getText().strip(), "PKCS12", d[0], d[1], d[2], d[3], d[4], file.getText().strip(), pw };
} catch (Exception ex) {
JOptionPane.showMessageDialog(parent, "The certificate could not be read: " + ex.getMessage(), "Client TLS certificate", JOptionPane.ERROR_MESSAGE);
}
}
}
/** The full details of a server certificate, from its stored encoding. */
private static void showCertificate(JComponent parent, String base64) {
String text;
try {
java.security.cert.X509Certificate x = (java.security.cert.X509Certificate) java.security.cert.CertificateFactory.getInstance("X.509")
.generateCertificate(new java.io.ByteArrayInputStream(java.util.Base64.getDecoder().decode(base64)));
StringBuilder sb = new StringBuilder();
sb.append("Subject: ").append(x.getSubjectX500Principal().getName()).append('\n');
sb.append("Issuer: ").append(x.getIssuerX500Principal().getName()).append('\n');
sb.append("Serial: ").append(x.getSerialNumber().toString(16)).append('\n');
sb.append("Valid from: ").append(x.getNotBefore()).append('\n');
sb.append("Valid to: ").append(x.getNotAfter()).append('\n');
sb.append("Signature: ").append(x.getSigAlgName()).append('\n');
sb.append("Public key: ").append(x.getPublicKey().getAlgorithm()).append('\n');
if (x.getSubjectAlternativeNames() != null) sb.append("Alt names: ").append(x.getSubjectAlternativeNames()).append('\n');
byte[] sha = java.security.MessageDigest.getInstance("SHA-256").digest(x.getEncoded());
StringBuilder fp = new StringBuilder();
for (byte b : sha) fp.append(fp.length() > 0 ? ":" : "").append(String.format("%02X", b));
sb.append("SHA-256: ").append(fp).append('\n');
text = sb.toString();
} catch (Exception e) {
text = "The certificate could not be read: " + e.getMessage();
}
JTextArea area = new JTextArea(text, 12, 80);
area.setEditable(false);
area.setFont(Ui.MONO);
JOptionPane.showMessageDialog(parent, Ui.scroll(area), "Server TLS certificate", JOptionPane.PLAIN_MESSAGE);
}
public static SettingsPage http(SuiteContext ctx) {
Settings s = ctx.settings();
SettingsPage p = new SettingsPage();
p.block("Allowed redirect types", SettingsPage.Kind.PROJECT,
"Use these settings to control the redirection types that Open Suite uses in situations where it is configured to follow redirections.",
() -> SettingsPage.clearPrefix(s, "http.redirect."),
opensuite.ui.Sections.text("When following redirections, understand the following types:"),
opensuite.ui.Sections.gap(5),
SettingsPage.check(s, "http.redirect.3xx", true, "3xx status code with Location header"),
SettingsPage.check(s, "http.redirect.refreshHeader", true, "Refresh header"),
SettingsPage.check(s, "http.redirect.metaRefresh", true, "Meta refresh tag"),
SettingsPage.check(s, "http.redirect.javascript", false, "JavaScript-driven"),
SettingsPage.check(s, "http.redirect.anyLocation", false, "Any status code with Location header"));
// The same tables as the target scope, over the URLs whose responses do not end.
opensuite.ui.ScopeEditor streaming = new opensuite.ui.ScopeEditor(ctx, ctx.streamingScope(), "http.streaming.advanced", true);
ctx.addScopeListener(ctx::saveDropScope);
p.block("Streaming responses", SettingsPage.Kind.PROJECT,
"Use these settings to specify which URLs return \"streaming\" responses, which do not terminate.",
() -> { SettingsPage.clearPrefix(s, "http.streaming."); streaming.refresh(); },
opensuite.ui.Sections.text("Open Suite handles streaming responses differently depending on the tool:\n"
+ "\u2022 Proxy passes these responses straight through to the client as data is received.\n"
+ "\u2022 Repeater updates the response panel in real time as data is received. You can set a timeout under Tools > Repeater > Streaming responses timeout.\n"
+ "\u2022 Other tools ignore streaming responses and close the connection.", 1),
opensuite.ui.Sections.gap(5),
streaming,
opensuite.ui.Sections.gap(10),
SettingsPage.check(s, "http.streaming.store", true, "Store streaming responses (may result in large temp files)"),
SettingsPage.check(s, "http.streaming.stripChunked", true, "Strip chunked encoding metadata in streaming responses"),
SettingsPage.check(s, "http.streaming.eventStream", true, "<html>Treat responses with the <code>text/event-stream</code> MIME type as streaming</html>"));
p.block("Status 100 response handling", SettingsPage.Kind.PROJECT,
"Controls how interim 100 Continue responses are handled.",
() -> { s.setBool("http.100.understand", true); s.setBool("http.100.remove", false); },
SettingsPage.check(s, "http.100.understand", true, "Understand 100 Continue responses"),
SettingsPage.check(s, "http.100.remove", false, "Remove 100 Continue headers"));
p.block("HTTP/1", SettingsPage.Kind.PROJECT, "Connection reuse for HTTP/1.",
() -> s.setBool("http.keepAlive", false),
SettingsPage.check(s, "http.keepAlive", false, "Use keep-alive for HTTP/1 if the server supports it"));
p.block("HTTP/2", SettingsPage.Kind.PROJECT, "Controls whether the tools use HTTP/2 with servers that offer it over TLS.",
() -> s.setBool("http.http2", true),
SettingsPage.check(s, "http.http2", true, "Default to HTTP/2 if the server supports it"));
p.block("Response handling", SettingsPage.Kind.PROJECT, "Controls how the tools handle response bodies and rendered pages.",
() -> { s.setBool("http.unpackGzip", true); s.setBool("render.allowHttp", false); },
SettingsPage.check(s, "http.unpackGzip", true, "Unpack gzip / deflate in responses"),
SettingsPage.check(s, "render.allowHttp", false, "Allow the renderer to make HTTP requests (for images, etc.)"));
return p;
}
}