Skip to content

Commit

Permalink
Fix ADRealmTests in FIPS 140 JVMs (elastic#47437)
Browse files Browse the repository at this point in the history
The changes introduced in elastic#47179 made it so that we could try to
build an SSLContext with verification mode set to None, which is
not allowed in FIPS 140 JVMs. This commit address that
  • Loading branch information
jkakavas committed Oct 12, 2019
1 parent d4f5376 commit 45edfbc
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,12 @@ private Settings settings(RealmConfig.RealmIdentifier realmIdentifier, Settings
.put(getFullSettingKey(realmIdentifier.getName(), ActiveDirectorySessionFactorySettings.AD_DOMAIN_NAME_SETTING),
"ad.test.elasticsearch.com")
.put(getFullSettingKey(realmIdentifier, DnRoleMapperSettings.USE_UNMAPPED_GROUPS_AS_ROLES_SETTING), true);
if (randomBoolean()) {
if (inFipsJvm()) {
builder.put(getFullSettingKey(realmIdentifier, SSLConfigurationSettings.VERIFICATION_MODE_SETTING_REALM),
VerificationMode.CERTIFICATE);
} else {
builder.put(getFullSettingKey(realmIdentifier, SSLConfigurationSettings.VERIFICATION_MODE_SETTING_REALM),
VerificationMode.NONE);
randomBoolean() ? VerificationMode.CERTIFICATE : VerificationMode.NONE);
}
return builder.put(extraSettings).build();
}
Expand Down

0 comments on commit 45edfbc

Please sign in to comment.