Search in sources :

Example 6 with ConnectionParam

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);
}
Also used : ConnectionParam(org.parosproxy.paros.network.ConnectionParam) DomainMatcher(org.zaproxy.zap.network.DomainMatcher)

Example 7 with ConnectionParam

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);
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam) ConnectionParam(org.parosproxy.paros.network.ConnectionParam)

Example 8 with 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);
}
Also used : StructuralNode(org.zaproxy.zap.model.StructuralNode) ScanPolicy(org.zaproxy.zap.extension.ascan.ScanPolicy) ConnectionParam(org.parosproxy.paros.network.ConnectionParam) I18N(org.zaproxy.zap.utils.I18N) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

ConnectionParam (org.parosproxy.paros.network.ConnectionParam)8 OptionsParam (org.parosproxy.paros.model.OptionsParam)4 ArrayList (java.util.ArrayList)2 SSLContextManager (ch.csnc.extension.httpclient.SSLContextManager)1 File (java.io.File)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1 KeyManagementException (java.security.KeyManagementException)1 KeyStoreException (java.security.KeyStoreException)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 CertificateException (java.security.cert.CertificateException)1 Date (java.util.Date)1 List (java.util.List)1 PatternSyntaxException (java.util.regex.PatternSyntaxException)1 JSONException (net.sf.json.JSONException)1 URI (org.apache.commons.httpclient.URI)1 URIException (org.apache.commons.httpclient.URIException)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Mode (org.parosproxy.paros.control.Control.Mode)1 ScannerParam (org.parosproxy.paros.core.scanner.ScannerParam)1