/** * * @param delegate */ public TokenBindingMitmCommandConfig(GeneralDelegate delegate) { super(delegate); mitmDelegate = new MitmDelegate(); addDelegate(mitmDelegate); timeoutDelegate = new TimeoutDelegate(); addDelegate(timeoutDelegate); }
@Override public void applyDelegate(Config config) { config.setDefaulRunningMode(RunningModeType.MITM); if (inboundConnectionStr != null) { setInboundConnection(config); } else { LOGGER.debug("Parameter -accept not specified. Using inbound connection from " + "-workflow_input or config defaults."); } if (outboundConnectionStr != null) { setOutboundConnection(config); } else { LOGGER.debug("Parameter -connect not specified. Using outbound connection from " + "-workflow_input or config defaults."); } }
private void setInboundConnection(Config config) { InboundConnection inboundConnection = config.getDefaultServerConnection(); if (inboundConnection == null) { inboundConnection = new InboundConnection(); config.setDefaultServerConnection(inboundConnection); } String[] parsedPort = inboundConnectionStr.split(":"); switch (parsedPort.length) { case 1: inboundConnection.setAlias("accept:" + parsedPort[0]); inboundConnection.setPort(parsePort(parsedPort[0])); break; case 2: inboundConnection.setAlias(parsedPort[0]); inboundConnection.setPort(parsePort(parsedPort[1])); break; default: throw new ConfigurationException("Could not parse provided accepting connection" + " end: " + inboundConnectionStr + ". Expected [CONNECTION_ALIAS:]<PORT>"); } config.setDefaultServerConnection(inboundConnection); }
private void setOutboundConnection(Config config) { OutboundConnection outboundConnection = config.getDefaultClientConnection(); if (outboundConnection == null) { outboundConnection = new OutboundConnection(); config.setDefaultClientConnection(outboundConnection); } String[] parsedHost = outboundConnectionStr.split(":"); switch (parsedHost.length) { case 2: outboundConnection.setHostname(parsedHost[0]); outboundConnection.setPort(parsePort(parsedHost[1])); outboundConnection.setAlias(outboundConnectionStr); break; case 3: outboundConnection.setAlias(parsedHost[0]); outboundConnection.setHostname(parsedHost[1]); outboundConnection.setPort(parsePort(parsedHost[2])); break; default: throw new ConfigurationException("Could not parse provided server address: " + outboundConnectionStr + ". Expected [CONNECTION_ALIAS:]<HOSTNAME>:<PORT>"); } config.setDefaultClientConnection(outboundConnection); }
/** * * @param delegate */ public SimpleMitmProxyCommandConfig(GeneralDelegate delegate) { super(delegate); mitmDelegate = new MitmDelegate(); ciphersuiteDelegate = new CiphersuiteDelegate(); certificateDelegate = new CertificateDelegate(); addDelegate(mitmDelegate); addDelegate(ciphersuiteDelegate); addDelegate(certificateDelegate); }
this.ellipticCurveDelegate = new NamedGroupsDelegate(); this.protocolVersionDelegate = new ProtocolVersionDelegate(); this.mitmDelegate = new MitmDelegate(); this.signatureAndHashAlgorithmDelegate = new SignatureAndHashAlgorithmDelegate(); this.transportHandlerDelegate = new TransportHandlerDelegate();