-
Notifications
You must be signed in to change notification settings - Fork 695
GEODE-9396: Upgrades using SSL fail with mismatch of hostname in certificates #6714
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
56db595 to
9435273
Compare
Bill
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.
Minor request for reordering a couple methods. Asking for clarification in some comments. And wondering whether we should add another condition in one place.
.../src/integrationTest/resources/org/apache/geode/codeAnalysis/sanctionedDataSerializables.txt
Outdated
Show resolved
Hide resolved
...rc/main/java/org/apache/geode/distributed/internal/membership/InternalDistributedMember.java
Show resolved
Hide resolved
...src/main/java/org/apache/geode/distributed/internal/membership/gms/MemberIdentifierImpl.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/apache/geode/distributed/internal/membership/gms/MemberIdentifierImpl.java
Outdated
Show resolved
Hide resolved
…ificates Co-authored-by: Bill Burcham <bill.burcham@gmail.com> Co-authored-by: Kamilla Aslami <kaslami@vmware.com>
9435273 to
fdf17cb
Compare
Bill
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.
Great work on this complicated ticket @kamilla1201!
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.
I'm wondering if someone would have a reason to specify an IP address as the bind address that this might break. Cases I could think about:
- Maybe there is no DNS name? The call to
getHost()might fail - Maybe the DNS server isn't updated at the time the member starts. This might be the case in a IaaS where VMs or containers are launched as soon as the gemfire process starts. I guess for this case an old member would be less likely to not be resolvable?
I'm not sure if this should reject this approach or not, if there are no better options. Or maybe we just handle failures from getHost and retain the IP address.
I wonder if it would be possible to fall back to the old logic for hostname validation if the member is from an old member, rather than changing the bind address when deserializing. Would that be doable or any safer? |
|
@upthewaterspout If there’s no DNS, then
I think we could do that in with something like: Here we know whether endpoint identification is enabled, which should help us avoid problems with IP numbers. |
|
Closing this PR because we decided to implement the fix that Dan suggested. |
The fix for GEODE-9139 has changed the way hostnames are handled when SNI endpoint validation is enabled. Because of that, when upgrading from some older versions of Geode to a version that contains the fix for GEODE-9139, the SSL handshake may fail to complete. This happens in cases where the call of
MemberData.getHostName()method on an older member returns an IP address. In the fix for GEODE-9139,Connection.createIoFilter()uses thehostnamefor endpoint identification, and if the certificate contains a symbolic name, endpoint identification will fail with "java.security.cert.CertificateException: No subject alternative names matching IP address" error.This change adds
fromDataPre_GEODE_1_15_0_0method toMemberIdentifierImplthat converts thehostnameof an older member to a hostname if it contains an IP address. This change also addstoDataPre_GEODE_1_15_0_0but it doesn't convert the hostname back to an IP address. We think there is no need to do that because the member is about to be upgraded and will have a hostname inhostnamefield anyway.Thank you for submitting a contribution to Apache Geode.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
For all changes:
Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
Has your PR been rebased against the latest commit within the target branch (typically
develop)?Is your initial contribution a single, squashed commit?
Does
gradlew buildrun cleanly?Have you written or updated unit tests to verify your changes?
If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
Note:
Please ensure that once the PR is submitted, check Concourse for build issues and
submit an update to your PR as soon as possible. If you need help, please send an
email to dev@geode.apache.org.