-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Remove X-Pack PemUtils and DerParser #76004
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
Remove X-Pack PemUtils and DerParser #76004
Conversation
This commit removes the PemUtils and DerParser classes from X-Pack and converts all use of those classes to the versions in libs/ssl-config Relates: elastic#68719
|
Pinging @elastic/es-security (Team:Security) |
| + cert.getClass() + ")"); | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't exactly in scope for this PR, but a test case was using the new method so it made sense to add it now..
| } catch (AccessControlException securityException) { | ||
| throw blockedKeyConfigFile(securityException, environment, KEY_FILE, key); | ||
| } catch (GeneralSecurityException e) { | ||
| throw new IllegalStateException("Error parsing Private Key from: " + keyPath, e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The X-Pack PemUtils would throw this IllegalStateException on GeneralSecurityException but the ssl-config version throws GeneralSecurityException.
This isn't the nicest way to handle it, but my plan is to get rid of this class (PEMKeyConfig) entirely, so I opted for the smallest possible change.
| assertThat(exception, throwableWithMessage( | ||
| "failed to initialize SSL " + sslManagerType + " - " + fileType + " file [" + fileName + "] does not exist")); | ||
| assertThat(exception, instanceOf(ElasticsearchException.class)); | ||
| // This is needed temporarily while we're converting from X-Pack SSL to libs/ssl-config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we've switched the PEM file reading over to ssl-config, but other scenarios are still using X-Pack, there's a mix of error messages in use.
This if is a temporary measure to keep this PR small, until we unify everything to depend on ssl-config.
|
@elasticmachine update branch |
jkakavas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
BigPandaToo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This commit removes the PemUtils and DerParser classes from X-Pack and
converts all use of those classes to the versions in libs/ssl-config
Relates: #68719