Le 10/02/16 16:37, Norbert Irmer a écrit :
>> seems like you have installed the proxy filter before the ssl filter in
>> your chain. Can you do the opposite ?
> I don't build the chain manually, I simply use a "ProxyConnector" (from
> package "org.apache.mina.proxy")
> to make a proxy connection (this also explains, why I had the
> SslFilter/autoStart problem in my earlier mail).
>
> "ProxyConnector" does the following in "setConnector":
>
>
> private void setConnector(final SocketConnector connector) {
> if (connector == null) {
> throw new IllegalArgumentException("connector cannot be null");
> }
>
> this.connector = connector;
> String className = ProxyFilter.class.getName();
>
> // Removes an old ProxyFilter instance from the chain
> if (connector.getFilterChain().contains(className)) {
> connector.getFilterChain().remove(className);
> }
>
> // Insert the ProxyFilter as the first filter in the filter chain
> builder
> connector.getFilterChain().addFirst(className, proxyFilter);
> }
Ok, but you can insert teh SslFilter *before* the proxyFilter. Once you
get the ProxyConnector instance, get the connector and do :
SslFilter sslFilter = new SslFilter(BogusSslContextFactory
.getInstance(true));
connector.getFilterChain().addFirst( "MySslFilter", sslFilter );