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());
}
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());
}
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());
}
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());
}
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());
}
Aggregations