Skip to content
This repository has been archived by the owner on Oct 16, 2018. It is now read-only.

Commit

Permalink
JuiCE support
Browse files Browse the repository at this point in the history
Make JCE the default security
provider. Falls back to standard
provider if JuiCE is not available.
  • Loading branch information
Brent Dirks committed Jun 14, 2016
1 parent e850b6a commit f1e1045
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions og-configuration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
<artifactId>og-openstack</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.cleversafe</groupId>
<artifactId>apache-juice</artifactId>
</dependency>
</dependencies>
<build>
<resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import static com.google.common.base.Preconditions.checkNotNull;

import java.io.File;
import java.security.Provider;
import java.security.Security;
import java.util.Collection;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
Expand Down Expand Up @@ -47,6 +49,7 @@
import com.google.inject.ProvisionException;
import com.google.inject.Stage;
import com.google.inject.spi.Message;
import org.apache.security.juice.provider.JuiCEProviderOpenSSL;

/**
* A cli for the Object Generator load tool
Expand Down Expand Up @@ -101,6 +104,17 @@ public static void main(final String[] args) {
final Statistics statistics = injector.getInstance(Statistics.class);
OGLog4jShutdownCallbackRegistry.setOGShutdownHook((new ShutdownHook(test, shutdownLatch)));

final Provider juiceProvider;
try {
juiceProvider = JuiCEProviderOpenSSL.getInstance();
Security.removeProvider(JuiCEProviderOpenSSL.NAME);
Security.insertProviderAt(juiceProvider, 1);
_consoleLogger.info("Using the JuiCE provider");
} catch (final Exception e) {
_consoleLogger.info(e.getMessage());
_consoleLogger.info("The JuiCE provider is not available on this platform.");
}

final LoadTestResult result = run(test, objectManager, statistics, gson);

shutdownLatch.countDown();
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@
<artifactId>aws-java-sdk-s3</artifactId>
<version>1.10.50</version>
</dependency>
<dependency>
<groupId>com.cleversafe</groupId>
<artifactId>apache-juice</artifactId>
<version>0.9.0.cs.fips.8</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
Expand Down

0 comments on commit f1e1045

Please sign in to comment.