Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

(SERVER-655) Fix Bouncy Castle jar load failure #548

Conversation

camlow325
Copy link
Contributor

This commit has changes which allow Puppet Server to boot without
JRuby's jopenssl trying to load its own Bouncy Castle jar.

Prior to JRuby 1.7.20, we set the JARS_NO_REQUIRE environment variable
onto the ScriptingContainer in order to instruct JRuby's
jar-dependencies to not try to load the Bouncy Castle jar - which we
intentionally exclude from the Puppet Server uberjar so that
'jvm-ssl-utils' can pull in its own version.

In JRuby 1.7.20's jopenssl, jar-dependencies was not being required
implicitly and so the JARS_NO_REQUIRE variable was ignored. This
led Puppet Server to fail to boot because the Bouncy Castle jar
could not be loaded.

This commit has Puppet Server do an explicit require of
jar-dependencies so that the JARS_NO_REQUIRE variable can be honored
properly again. It also sets JARS_REQUIRE, as that appears to be
the environment variable which jar-dependencies will eventually
replace JARS_NO_REQUIRE with.

This commit has changes which allow Puppet Server to boot without
JRuby's jopenssl trying to load its own Bouncy Castle jar.

Prior to JRuby 1.7.20, we set the JARS_NO_REQUIRE environment variable
onto the ScriptingContainer in order to instruct JRuby's
jar-dependencies to not try to load the Bouncy Castle jar - which we
intentionally exclude from the Puppet Server uberjar so that
'jvm-ssl-utils' can pull in its own version.

In JRuby 1.7.20's jopenssl, jar-dependencies was not being required
implicitly and so the JARS_NO_REQUIRE variable was ignored.  This
led Puppet Server to fail to boot because the Bouncy Castle jar
could not be loaded.

This commit has Puppet Server do an explicit require of
jar-dependencies so that the JARS_NO_REQUIRE variable can be honored
properly again.  It also sets JARS_REQUIRE, as that appears to be
the environment variable which jar-dependencies will eventually
replace JARS_NO_REQUIRE with.
@camlow325 camlow325 force-pushed the bug/stable/SERVER-655-fix-bouncycastle-load-failure branch from 9e01be5 to c326b45 Compare May 19, 2015 18:29
@camlow325 camlow325 changed the title (SERVER-644) Fix Bouncy Castle jar load failure (SERVER-655) Fix Bouncy Castle jar load failure May 19, 2015
@KevinCorcoran
Copy link
Contributor

This is disgusting, but 👍

@camlow325
Copy link
Contributor Author

For consistency, I updated the gem, irb, and ruby subcommands to use the same approach for requiring 'jar-dependencies' and setting the additional JARS_REQUIRE environment variable. I didn't bother duplicating the comments about why this was needed over to the subcommands - mostly since I'm hoping this stuff still will get consolidated soon as part of the work in SERVER-297. In any event, I did exercise each of these subcommands from the command line locally to see that they all still basically work with the changes. For that, I just ran the subcommands via an uberjar that I'd built locally with the changes.

@nwolfe
Copy link
Contributor

nwolfe commented May 19, 2015

👍

nwolfe added a commit that referenced this pull request May 19, 2015
…cycastle-load-failure

(SERVER-655) Fix Bouncy Castle jar load failure
@nwolfe nwolfe merged commit 453176d into puppetlabs:stable May 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants