-
Notifications
You must be signed in to change notification settings - Fork 68
Fix wrong using of certificates in ZAAS client #1514
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
Conversation
The changes to the error code documentation are available in this PR: zowe/docs-site#1699 |
What happens when the |
All the current users of ZAAS client are affected. If they are calling login() or query() there will be problems when client cert authentication is enabled in Zowe. Is there an alternative solution that would not require all such users of ZaasClient to be updated? |
The see: tokens = new ZaasJwtService(httpClientProviderWithoutCert, baseUrl); // updated configuration - without keyStore* values
passTickets = new PassTicketServiceImpl(httpClientProvider, baseUrl); // same configuration like before PR |
Workaround what I have in the mind:
I guess, unfortunately, no ideas above are better than the upgrade of ZAAS client. |
You are right, upgrade of the ZaasClient seems better than the alternative above. What about following approach that will need a change in API ML only?
|
So it means that the ticket will not work after this fix? Does X509 authentication has higher priority for the /ticket as well? |
I am not an APIML expert, but I guess |
I mean that API ML has introduced a breaking change with the X509 authentication. The applications (users of ZaasClient) that behave correctly (sending client certificate is correct for ticket endpoint and not forbidden for other endpoints) will not work. |
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.
Code has low test coverage(not all because of these changes), I can help with that if you have a lot of work. Thanks.
private final PassTicketService passTickets; | ||
|
||
public ZaasClientImpl(ConfigProperties configProperties) throws ZaasConfigurationException { | ||
if (configProperties.getKeyStorePath() == null) { |
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.
It means that you have to provide keystore path also for Http client?
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.
You are right, this is not complete condition. I have fixed it.
} | ||
|
||
CloseableClientProvider httpClientProvider = getTokenProvider(configProperties); | ||
CloseableClientProvider httpClientProviderWithoutCert = getTokenProviderWithoutCert(configProperties, httpClientProvider); |
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.
In case of HTTP , the same provider object is used, in case of HTTPS, there are 2 objects being created, is this intentional?
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.
Yes, it is, in the case of HTTP there is no needed to make two instances. But the purpose is the question because HTTP is not possible to use (except the theoretical configuration). It should be just for ATTLS, but then it is too difficult (maybe impossible) to establish to respect URL and using a client certificate.
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.
We should focus on the possibility, how to use ZAAS client with AT-TLS in the next issue. Thank you for finding that.
private boolean nonStrictVerifySslCertificatesOfServices; | ||
|
||
@Tolerate | ||
public ConfigProperties() { |
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.
Did you consider using NoArgs and AllArgs annotations instead of this experimental one?
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.
It was my first attempt, but it doesn't work together with @builder. Just this annotation solved it.
Signed-off-by: Pavel Jareš <pavel.jares@broadcom.com>
SonarCloud Quality Gate failed. |
@achmelo is the review complete? If we want to release this, we should merge before Friday. Thanks! |
Signed-off-by: Pavel Jareš pavel.jares@broadcom.com
Description
This PR changes the setting of HTTP clients in ZAAS client. It uses now two different clients:
Change also required to move verification about settings of keyring to another class. Therefore few tests should be moved and fixed.
It will be great to put In the right documentation warning about using ZAAS client (but I am not sure where). ZAAS client before this PR should be used only against Gateway with disabled client certificates and each application using ZAAS client should be upgraded as soon as possible to avoid this issue.
Linked to #1513 (issue)
Type of change
Please delete options that are not relevant.
Checklist:
For more details about how should the code look like read the Contributing guideline