Skip to content
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
3 changes: 2 additions & 1 deletion realm/realm-library/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ use_realm_core(${build_SYNC} "${REALM_CORE_DIST_DIR}" "${CORE_SOURCE_PATH}")
set(openssl_build_TYPE "release")
# FIXME Read the openssl version from core when the core/sync release has that information.
set(openssl_VERSION "1.0.2k")
set(openssl_FILENAME "openssl-${openssl_build_TYPE}-${openssl_VERSION}-Android-${ANDROID_ABI}")
set(openssl_BUILD_NUMBER "1")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the next core release, this will be removed since core will ship a openssl lib. no need to download anymore.

set(openssl_FILENAME "openssl-${openssl_build_TYPE}-${openssl_VERSION}-${openssl_BUILD_NUMBER}-Android-${ANDROID_ABI}")
set(openssl_URL "http://static.realm.io/downloads/openssl/${openssl_VERSION}/Android/${ANDROID_ABI}/${openssl_FILENAME}.tar.gz")

message(STATUS "Downloading OpenSSL...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import static org.junit.Assert.fail;

@RunWith(AndroidJUnit4.class)
@Ignore("See https://github.com/realm/ros/issues/240")
public class SSLConfigurationTests extends StandardIntegrationTest {

@Rule
Expand All @@ -65,12 +64,12 @@ public void trustedRootCA() throws InterruptedException {
SystemClock.sleep(TimeUnit.SECONDS.toMillis(2)); // FIXME: Replace with Sync Progress Notifications once available.
realm.close();
user.logout();
Realm.deleteRealm(configOld);

// 2. Local state should now be completely reset. Open the Realm again with a new configuration which should
// download the uploaded changes.
user = SyncUser.login(SyncCredentials.usernamePassword(username, password), Constants.AUTH_URL);
SyncConfiguration config = configurationFactory.createSyncConfigurationBuilder(user, Constants.USER_REALM_SECURE)
.name("useSsl")
.schema(StringOnly.class)
.waitForInitialRemoteData()
.trustedRootCA("trusted_ca.pem")
Expand Down Expand Up @@ -106,12 +105,12 @@ public void withoutSSLVerification() throws InterruptedException {
SystemClock.sleep(TimeUnit.SECONDS.toMillis(2)); // FIXME: Replace with Sync Progress Notifications once available.
realm.close();
user.logout();
Realm.deleteRealm(configOld);

// 2. Local state should now be completely reset. Open the Realm again with a new configuration which should
// download the uploaded changes.
user = SyncUser.login(SyncCredentials.usernamePassword(username, password), Constants.AUTH_URL);
SyncConfiguration config = configurationFactory.createSyncConfigurationBuilder(user, Constants.USER_REALM_SECURE)
.name("useSsl")
.schema(StringOnly.class)
.waitForInitialRemoteData()
.disableSSLVerification()
Expand Down Expand Up @@ -147,12 +146,12 @@ public void trustedRootCA_syncShouldFailWithoutTrustedCA() throws InterruptedExc
SystemClock.sleep(TimeUnit.SECONDS.toMillis(2)); // FIXME: Replace with Sync Progress Notifications once available.
realm.close();
user.logout();
Realm.deleteRealm(configOld);

// 2. Local state should now be completely reset. Open the Realm again with a new configuration which should
// download the uploaded changes.
user = SyncUser.login(SyncCredentials.usernamePassword(username, password), Constants.AUTH_URL);
SyncConfiguration config = configurationFactory.createSyncConfigurationBuilder(user, Constants.USER_REALM_SECURE)
.name("useSsl")
.schema(StringOnly.class)
.build();
realm = Realm.getInstance(config);
Expand All @@ -170,6 +169,7 @@ public void combining_trustedRootCA_and_withoutSSLVerification_willThrow() {
SyncUser user = SyncUser.login(SyncCredentials.usernamePassword(username, password, true), Constants.AUTH_URL);

TestHelper.TestLogger testLogger = new TestHelper.TestLogger();
int originalLevel = RealmLog.getLevel();
RealmLog.add(testLogger);
RealmLog.setLevel(LogLevel.WARN);

Expand All @@ -181,6 +181,8 @@ public void combining_trustedRootCA_and_withoutSSLVerification_willThrow() {

assertEquals("SSL Verification is disabled, the provided server certificate will not be used.",
testLogger.message);
RealmLog.remove(testLogger);
RealmLog.setLevel(originalLevel);
}

@Test
Expand Down
4 changes: 4 additions & 0 deletions tools/sync_test_server/ros-testing-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ function startRealmObjectServer(onSuccess, onError) {
['start',
'--data', path,
'--loglevel', 'detail',
'--https',
'--https-key', '/127_0_0_1-server.key.pem',
'--https-cert', '/127_0_0_1-chain.crt.pem',
'--https-port', '9443',
'--access-token-ttl', '20' //WARNING : Changing this value may impact the timeout of the refresh token test (AuthTests#preemptiveTokenRefresh)
],
{ env: env, cwd: path});
Expand Down