Skip to content

Preferred proxy authentication methods removed #296

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,6 @@ public static ProxyConnector createIoProxyConnector(SocketConnector socketConnec
}

ProxyIoSession proxyIoSession = new ProxyIoSession(proxyAddress, req);

List<HttpAuthenticationMethods> l = new ArrayList<>();
l.add(HttpAuthenticationMethods.NO_AUTH);
l.add(HttpAuthenticationMethods.DIGEST);
l.add(HttpAuthenticationMethods.BASIC);

proxyIoSession.setPreferedOrder(l);
connector.setProxyIoSession(proxyIoSession);

return connector;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*******************************************************************************
* Copyright (c) quickfixengine.org All rights reserved.
*
* This file is part of the QuickFIX FIX Engine
*
* This file may be distributed under the terms of the quickfixengine.org
* license as defined by quickfixengine.org and appearing in the file
* LICENSE included in the packaging of this file.
*
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
* THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE.
*
* See http://www.quickfixengine.org/LICENSE for licensing information.
*
* Contact ask@quickfixengine.org if any conditions of this licensing
* are not clear to you.
******************************************************************************/

package quickfix.mina;

import org.apache.mina.core.service.IoConnector;
import org.apache.mina.proxy.ProxyConnector;
import org.apache.mina.proxy.session.ProxyIoSession;
import org.apache.mina.transport.socket.SocketConnector;
import org.apache.mina.util.AvailablePortFinder;
import org.junit.Test;
import quickfix.ConfigError;

import java.net.InetSocketAddress;

import static org.junit.Assert.assertNull;

public class ProtocolFactoryTest {

@Test
public void shouldCreateProxyConnectorWithoutPreferredAuthOrder() throws ConfigError {
InetSocketAddress address = new InetSocketAddress(AvailablePortFinder.getNextAvailable());
InetSocketAddress proxyAddress = new InetSocketAddress(AvailablePortFinder.getNextAvailable());

IoConnector connector = ProtocolFactory.createIoConnector(address);
ProxyConnector proxyConnector = ProtocolFactory
.createIoProxyConnector((SocketConnector) connector, address, proxyAddress, "http", "1.0", "user",
"password", "domain", "workstation");

ProxyIoSession proxySession = proxyConnector.getProxyIoSession();
assertNull(proxySession.getPreferedOrder());
}
}