Search in sources :

Example 11 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsCertificatePanel method saveParam.

@Override
public void saveParam(Object obj) throws Exception {
    OptionsParam options = (OptionsParam) obj;
    OptionsParamCertificate certParam = options.getCertificateParam();
    certParam.setEnableCertificate(useClientCertificateCheckBox.isSelected());
    certParam.setAllowUnsafeSslRenegotiation(enableUnsafeSSLRenegotiationCheckBox.isSelected());
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam)

Example 12 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsConnectionPanel method saveParam.

@Override
public void saveParam(Object obj) throws Exception {
    OptionsParam optionsParam = (OptionsParam) obj;
    ConnectionParam connectionParam = optionsParam.getConnectionParam();
    int timeout;
    try {
        timeout = Integer.parseInt(txtTimeoutInSecs.getText());
    } catch (NumberFormatException nfe) {
        txtTimeoutInSecs.requestFocus();
        throw new Exception(Constant.messages.getString("conn.options.timeout.invalid"));
    }
    connectionParam.setProxyChainName(txtProxyChainName.getText());
    // ZAP: Do not allow invalid port numbers
    connectionParam.setProxyChainPort(spinnerProxyChainPort.getValue());
    connectionParam.setProxyExcludedDomains(getProxyExcludedDomainsTableModel().getElements());
    connectionParam.setConfirmRemoveProxyExcludedDomain(!getProxyExcludedDomainsPanel().isRemoveWithoutConfirmation());
    connectionParam.setProxyChainRealm(txtProxyChainRealm.getText());
    connectionParam.setProxyChainUserName(txtProxyChainUserName.getText());
    connectionParam.setProxyChainPrompt(chkProxyChainPrompt.isSelected());
    // ZAP: Added prompt option
    if (chkUseProxyChain.isSelected() && chkProxyChainAuth.isSelected() && chkProxyChainPrompt.isSelected()) {
        if (View.isInitialised()) {
            // And prompt now
            ProxyDialog dialog = new ProxyDialog(View.getSingleton().getMainFrame(), true);
            dialog.init(Model.getSingleton().getOptionsParam());
            dialog.setVisible(true);
        }
    } else {
        connectionParam.setProxyChainPassword(new String(txtProxyChainPassword.getPassword()));
    }
    connectionParam.setTimeoutInSecs(timeout);
    connectionParam.setSingleCookieRequestHeader(checkBoxSingleCookieRequestHeader.isSelected());
    connectionParam.setUseProxyChain(chkUseProxyChain.isSelected());
    connectionParam.setUseProxyChainAuth(chkProxyChainAuth.isSelected());
    connectionParam.setDnsTtlSuccessfulQueries(dnsTtlSuccessfulQueriesNumberSpinner.getValue());
    connectionParam.setSecurityProtocolsEnabled(securityProtocolsPanel.getSelectedProtocols());
    connectionParam.setDefaultUserAgent(defaultUserAgent.getText());
}
Also used : ProxyDialog(org.zaproxy.zap.view.ProxyDialog) OptionsParam(org.parosproxy.paros.model.OptionsParam) ConnectionParam(org.parosproxy.paros.network.ConnectionParam)

Example 13 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsCertificatePanel method initParam.

@Override
public void initParam(Object obj) {
    OptionsParam options = (OptionsParam) obj;
    OptionsParamCertificate certParam = options.getCertificateParam();
    useClientCertificateCheckBox.setSelected(certParam.isUseClientCert());
    //getBtnLocation().setEnabled(getChkUseClientCertificate().isSelected());
    //getTxtLocation().setText(options.getCertificateParam().getClientCertLocation());
    enableUnsafeSSLRenegotiationCheckBox.setSelected(certParam.isAllowUnsafeSslRenegotiation());
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam)

Example 14 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsDatabasePanel method saveParam.

@Override
public void saveParam(Object obj) throws Exception {
    final OptionsParam options = (OptionsParam) obj;
    final DatabaseParam param = options.getDatabaseParam();
    param.setCompactDatabase(checkBoxCompactDatabase.isSelected());
    param.setRequestBodySize(spinnerRequestBodySize.getValue());
    param.setResponseBodySize(spinnerResponseBodySize.getValue());
    param.setNewSessionPrompt(checkBoxNewSessionPrompt.isSelected());
    param.setNewSessionOption(comboNewSessionOption.getSelectedIndex());
    param.setRecoveryLogEnabled(checkBoxRecoveryLog.isSelected());
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam)

Example 15 with OptionsParam

use of org.parosproxy.paros.model.OptionsParam in project zaproxy by zaproxy.

the class OptionsLocalProxyPanel method saveParam.

@Override
public void saveParam(Object obj) throws Exception {
    OptionsParam optionsParam = (OptionsParam) obj;
    ProxyParam proxyParam = optionsParam.getProxyParam();
    proxyParam.setProxyIp(txtProxyIp.getText());
    // ZAP: Do not allow invalid port numbers
    proxyParam.setProxyPort(spinnerProxyPort.getValue());
    proxyParam.setRemoveUnsupportedEncodings(getChkRemoveUnsupportedEncodings().isSelected());
    // TODO hacking
    proxyParam.setAlwaysDecodeGzip(getChkAlwaysDecodeGzip().isSelected());
    proxyParam.setReverseProxyIp(txtReverseProxyIp.getText());
    // ZAP: Do not allow invalid port numbers
    proxyParam.setReverseProxyHttpPort(spinnerReverseProxyHttpPort.getValue());
    proxyParam.setReverseProxyHttpsPort(spinnerReverseProxyHttpsPort.getValue());
    proxyParam.setUseReverseProxy(getChkReverseProxy().isSelected());
    proxyParam.setSecurityProtocolsEnabled(securityProtocolsPanel.getSelectedProtocols());
}
Also used : OptionsParam(org.parosproxy.paros.model.OptionsParam) ProxyParam(org.parosproxy.paros.core.proxy.ProxyParam)

Aggregations

OptionsParam (org.parosproxy.paros.model.OptionsParam)56 ScannerParam (org.parosproxy.paros.core.scanner.ScannerParam)4 ConnectionParam (org.parosproxy.paros.network.ConnectionParam)4 File (java.io.File)3 ViewLocale (org.zaproxy.zap.view.ViewLocale)3 ProxyParam (org.parosproxy.paros.core.proxy.ProxyParam)2 Extension (org.parosproxy.paros.extension.Extension)2 SpiderParam (org.zaproxy.zap.spider.SpiderParam)2 HeadlessException (java.awt.HeadlessException)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 MissingResourceException (java.util.MissingResourceException)1 JButton (javax.swing.JButton)1 UnsupportedLookAndFeelException (javax.swing.UnsupportedLookAndFeelException)1 ConfigurationException (org.apache.commons.configuration.ConfigurationException)1 JXErrorPane (org.jdesktop.swingx.JXErrorPane)1 ErrorInfo (org.jdesktop.swingx.error.ErrorInfo)1