use of ch.cyberduck.core.ssl.DefaultX509TrustManager in project cyberduck by iterate-ch.
the class AbstractBrickTest method setup.
@Before
public void setup() throws Exception {
final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new BrickProtocol())));
final Profile profile = new ProfilePlistReader(factory).read(this.getClass().getResourceAsStream("/Brick.cyberduckprofile"));
final Host host = new Host(profile, "mountainduck.files.com", new Credentials(System.getProperties().getProperty("brick.user"), System.getProperties().getProperty("brick.password")));
session = new BrickSession(host, new DefaultX509TrustManager(), new DefaultX509KeyManager());
final LoginConnectionService login = new LoginConnectionService(new DisabledLoginCallback() {
@Override
public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
fail(reason);
return null;
}
}, new DisabledHostKeyCallback(), new DisabledPasswordStore(), new DisabledProgressListener());
login.check(session, new DisabledCancelCallback());
}
use of ch.cyberduck.core.ssl.DefaultX509TrustManager in project cyberduck by iterate-ch.
the class AbtractBoxTest method setup.
@Before
public void setup() throws Exception {
final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new BoxProtocol())));
final Profile profile = new ProfilePlistReader(factory).read(this.getClass().getResourceAsStream("/Box.cyberduckprofile"));
final Host host = new Host(profile, profile.getDefaultHostname(), new Credentials("cyberduck"));
session = new BoxSession(host, new DefaultX509TrustManager(), new DefaultX509KeyManager());
final LoginConnectionService login = new LoginConnectionService(new DisabledLoginCallback() {
@Override
public Credentials prompt(final Host bookmark, final String title, final String reason, final LoginOptions options) {
fail(reason);
return null;
}
}, new DisabledHostKeyCallback(), new TestPasswordStore(), new DisabledProgressListener());
login.check(session, new DisabledCancelCallback());
}
use of ch.cyberduck.core.ssl.DefaultX509TrustManager in project cyberduck by iterate-ch.
the class AbstractGoogleStorageTest method setup.
@Before
public void setup() throws Exception {
final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new GoogleStorageProtocol())));
final Profile profile = new ProfilePlistReader(factory).read(this.getClass().getResourceAsStream("/Google Cloud Storage.cyberduckprofile"));
final Host host = new Host(profile, profile.getDefaultHostname(), new Credentials(System.getProperties().getProperty("google.projectid"), null));
session = new GoogleStorageSession(host, new DefaultX509TrustManager(), new DefaultX509KeyManager());
final LoginConnectionService login = new LoginConnectionService(new DisabledLoginCallback() {
@Override
public Credentials prompt(final Host bookmark, final String username, final String title, final String reason, final LoginOptions options) {
fail(reason);
return null;
}
}, new DisabledHostKeyCallback(), new DisabledPasswordStore() {
@Override
public String getPassword(final Scheme scheme, final int port, final String hostname, final String user) {
if (user.equals("Google Cloud Storage (api-project-408246103372) OAuth2 Access Token")) {
return System.getProperties().getProperty("google.accesstoken");
}
if (user.equals("Google Cloud Storage (api-project-408246103372) OAuth2 Refresh Token")) {
return System.getProperties().getProperty("google.refreshtoken");
}
return null;
}
}, new DisabledProgressListener());
login.check(session, new DisabledCancelCallback());
}
use of ch.cyberduck.core.ssl.DefaultX509TrustManager in project cyberduck by iterate-ch.
the class OneDriveBusinessContextLoginTest method testLogin.
@Test(expected = LoginCanceledException.class)
public void testLogin() throws Exception {
final ProtocolFactory factory = new ProtocolFactory(new HashSet<>(Collections.singleton(new OneDriveProtocol())));
final Profile profile = new ProfilePlistReader(factory).read(this.getClass().getResourceAsStream("/Microsoft SharePoint.cyberduckprofile"));
final Host host = new Host(profile, profile.getDefaultHostname());
final OneDriveSession session = new OneDriveSession(host, new DefaultX509TrustManager(), new DefaultX509KeyManager());
new LoginConnectionService(new DisabledLoginCallback() {
@Override
public Credentials prompt(final Host bookmark, final String username, final String title, final String reason, final LoginOptions options) throws LoginCanceledException {
assertEquals("OAuth2 Authentication", title);
throw new LoginCanceledException();
}
}, new DisabledHostKeyCallback(), new DisabledPasswordStore() {
@Override
public String getPassword(Scheme scheme, int port, String hostname, String user) {
if ("Microsoft OneDrive Business OAuth2 Access Token".equals(user)) {
return System.getProperties().getProperty("onedrive.business.accesstoken");
}
if ("Microsoft OneDrive Business OAuth2 Refresh Token".equals(user)) {
return System.getProperties().getProperty("onedrive.business.refreshtoken");
}
return null;
}
@Override
public String getPassword(String hostname, String user) {
return super.getPassword(hostname, user);
}
}, new DisabledProgressListener()).connect(session, new DisabledCancelCallback());
assertEquals("/b!9prv2DvXt0Cua27a0kKBHlYP69u02QdCtkueQRimv8UsYPDHr-_uQoMvBiuYAjdH", (new OneDriveHomeFinderService().find().getAbsolute()));
}
use of ch.cyberduck.core.ssl.DefaultX509TrustManager in project cyberduck by iterate-ch.
the class CustomOriginCloudFrontDistributionConfigurationTest method testReadMissingCredentials.
@Test(expected = LoginCanceledException.class)
public void testReadMissingCredentials() throws Exception {
final Host bookmark = new Host(new TestProtocol(), "myhost.localdomain");
final CustomOriginCloudFrontDistributionConfiguration configuration = new CustomOriginCloudFrontDistributionConfiguration(bookmark, new DefaultX509TrustManager(), new DefaultX509KeyManager());
final Path container = new Path("test-eu-central-1-cyberduck", EnumSet.of(Path.Type.directory, Path.Type.volume));
configuration.read(container, Distribution.CUSTOM, new DisabledLoginCallback());
}
Aggregations