use of org.parosproxy.paros.network.ConnectionParam in project zaproxy by zaproxy.
the class CoreAPI method setProxyChainExcludedDomainsEnabled.
private void setProxyChainExcludedDomainsEnabled(boolean enabled) {
ConnectionParam connectionParam = Model.getSingleton().getOptionsParam().getConnectionParam();
List<DomainMatcher> domains = connectionParam.getProxyExcludedDomains();
for (DomainMatcher domain : domains) {
domain.setEnabled(enabled);
}
connectionParam.setProxyExcludedDomains(domains);
}
use of org.parosproxy.paros.network.ConnectionParam in project zaproxy by zaproxy.
the class OptionsConnectionPanel method initParam.
@Override
public void initParam(Object obj) {
OptionsParam optionsParam = (OptionsParam) obj;
ConnectionParam connectionParam = optionsParam.getConnectionParam();
this.spinnerTimeoutInSecs.setValue(connectionParam.getTimeoutInSecs());
checkBoxSingleCookieRequestHeader.setSelected(connectionParam.isSingleCookieRequestHeader());
checkBoxHttpStateEnabled.setSelected(connectionParam.isHttpStateEnabled());
getProxyExcludedDomainsTableModel().setExcludedDomains(connectionParam.getProxyExcludedDomains());
getProxyExcludedDomainsPanel().setRemoveWithoutConfirmation(!connectionParam.isConfirmRemoveProxyExcludedDomain());
chkUseProxyChain.setSelected(connectionParam.isUseProxyChain());
// set Proxy Chain parameters
txtProxyChainName.setText(connectionParam.getProxyChainName());
txtProxyChainName.discardAllEdits();
// ZAP: Do not allow invalid port numbers
spinnerProxyChainPort.setValue(connectionParam.getProxyChainPort());
chkProxyChainAuth.setSelected(connectionParam.isUseProxyChainAuth());
txtProxyChainRealm.setText(connectionParam.getProxyChainRealm());
txtProxyChainRealm.discardAllEdits();
txtProxyChainUserName.setText(connectionParam.getProxyChainUserName());
txtProxyChainUserName.discardAllEdits();
chkProxyChainPrompt.setSelected(connectionParam.isProxyChainPrompt());
// Default don't show (everytime)
chkShowPassword.setSelected(false);
// Default mask (everytime)
txtProxyChainPassword.setEchoChar('*');
setProxyChainEnabled(connectionParam.isUseProxyChain());
if (!connectionParam.isProxyChainPrompt()) {
txtProxyChainPassword.setText(connectionParam.getProxyChainPassword());
}
dnsTtlSuccessfulQueriesNumberSpinner.setValue(connectionParam.getDnsTtlSuccessfulQueries());
securityProtocolsPanel.setSecurityProtocolsEnabled(connectionParam.getSecurityProtocolsEnabled());
defaultUserAgent.setText(connectionParam.getDefaultUserAgent());
setUaFromString();
socksProxyPanel.initParam(connectionParam);
}
use of org.parosproxy.paros.network.ConnectionParam in project zaproxy by zaproxy.
the class HostProcessUnitTest method setup.
@BeforeEach
void setup() {
Constant.messages = new I18N(Locale.ENGLISH);
rootNode = mock(StructuralNode.class);
given(rootNode.getName()).willReturn("Sites");
hostAndPort = "http://localhost:80";
scanner = mock(Scanner.class);
given(scanner.isInScope(any())).willReturn(true);
scannerParam = mock(ScannerParam.class);
connectionParam = mock(ConnectionParam.class);
pluginFactory = mock(PluginFactory.class);
given(pluginFactory.clone()).willReturn(pluginFactory);
ScanPolicy scanPolicy = mock(ScanPolicy.class);
given(scanPolicy.getPluginFactory()).willReturn(pluginFactory);
hostProcess = new HostProcess(hostAndPort, scanner, scannerParam, connectionParam, scanPolicy, ruleConfigParam);
}
Aggregations