apache/cassandra · error · IllegalArgumentException
Configuration must specify value for either…
Error message
Configuration must specify value for either outbound_keystore or outbound_private_key, not both for PEMBasedSSlContextFactory
What it means
Fires during PEMBasedSslContextFactory initialization when both outbound_keystore and outbound_private_key are set. The outbound (secondary) encryption identity may come from only one source; specifying both is an ambiguous configuration rejected by enforceSinglePrivateKeySource.
Solutions
- Configure only one of outbound_keystore or outbound_private_key in cassandra.yaml
- If outbound identity should mirror the inbound one, omit the outbound_* options entirely so defaults apply
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/java/org/apache/cassandra/security/PEMBasedSslContextFactory.java:363 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/a395a948303d0abe.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/security/PEMBasedSslContextFactory.java:363
keyStore.setCertificateEntry("cassandra-ssl-trusted-cert-" + (i + 1), certChainArray[i]);
}
return keyStore;
}
/**
* Enforces that the configuration specified a sole source of loading private keys - either {@code keystore} (the
* actual file must exist) or {@code private_key}, not both.
*/
private void enforceSinglePrivateKeySource()
{
if (keystoreContext.hasKeystore() && !StringUtils.isEmpty(pemEncodedKeyContext.key))
{
throw new IllegalArgumentException("Configuration must specify value for either keystore or private_key, " +
"not both for PEMBasedSSlContextFactory");
}
if (outboundKeystoreContext.hasKeystore() && !StringUtils.isEmpty(pemEncodedOutboundKeyContext.key))
{
throw new IllegalArgumentException("Configuration must specify value for either outbound_keystore or outbound_private_key, " +
"not both for PEMBasedSSlContextFactory");
}
}
/**
* Enforces that the configuration specified a sole source of loading trusted certificates - either {@code
* truststore} (actual file must exist) or {@code trusted_certificates}, not both.
*/
private void enforceSingleTurstedCertificatesSource()
{
if (truststoreFileExists() && !StringUtils.isEmpty(pemEncodedTrustCertificates.key))
{
throw new IllegalArgumentException("Configuration must specify value for either truststore or " +
"trusted_certificates, not both for PEMBasedSSlContextFactory");
}
}
public static class PEMBasedKeyStoreContextView on GitHub (pinned to 88fd0f6a0e)