[CONJ-511] Add legacy SSL certificate Hostname verification with CN even when SAN are set Created: 2017-08-22 Updated: 2017-08-29 Resolved: 2017-08-28 |
|
| Status: | Closed |
| Project: | MariaDB Connector/J |
| Component/s: | TLS |
| Affects Version/s: | None |
| Fix Version/s: | 2.1.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | Diego Dupin | Assignee: | Diego Dupin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
After invertigating joseph.witthuhn comment, and verification on SSL with aurora : Issue is that when certificate has alternate names, only alt-name verification is executed as RFC 6125 indicate, hostname verification should be done against the certificate’s subjectAlternativeName’s dNSName field. That is not compatible with connecting directly aurora host. Correction is to permit legacy CN verification when SAN doesn't match hostname. |
| Comments |
| Comment by Joseph Witthuhn [ 2017-08-22 ] | ||||||||||||||||||||||||
|
I appreciate that you are taking a look at this. I do have an open case with AWS (since August 2nd) where they are investigating fixing the Aurora certificates from their end. They haven't provided an ETA yet, but that is likely a better "long term" fix, assuming the fix eventually gets pushed out to all of their users. | ||||||||||||||||||||||||
| Comment by Diego Dupin [ 2017-08-22 ] | ||||||||||||||||||||||||
|
To have a better explaination, taking the example of aurora certificates :
Good certificates for instance A would have SANs "X.cluster-Y.amazonaws.com", "X.cluster-ro-Y.amazonaws.com" AND "A.Y.amazonaws.com" But Aurora has certificates with subject "C=US, ST=Washington, L=Seattle, O=Amazon.com, OU=RDS, CN=A.Y.amazonaws.com" and SANs "X.cluster-Y.amazonaws.com", "X.cluster-ro-Y.amazonaws.com" WITHOUT "A.Y.amazonaws.com" This kind of certificate are deprecated since a long time (support of that has been completely removed in navigator : firefox, Driver use the cluster DNS to initially create the connection, but create a slave connection under the hood that cannot be validated without supporting CN hostname validation. | ||||||||||||||||||||||||
| Comment by Diego Dupin [ 2017-08-23 ] | ||||||||||||||||||||||||
|
Correction is done on SNAPSHOT version, available on maven using :
joseph.witthuhn Can you confirm that this solve your issue ? | ||||||||||||||||||||||||
| Comment by Joseph Witthuhn [ 2017-08-23 ] | ||||||||||||||||||||||||
|
It doesn't appear to. I get the same exception, except I can tell it is longer because it is now checking additional fields. This was my original exception:
This is my new exception with the snapshot:
The code I used to perform this test was simply:
In this case, d-p-m-c.cluster-ijklmno5p6qr.us-east-1.rds.amazonaws.com, is the value that appears in our cluster endpoint. As I mentioned above, AWS has admitted this is likely an issue on their end and is investigating a fix. | ||||||||||||||||||||||||
| Comment by Diego Dupin [ 2017-08-24 ] | ||||||||||||||||||||||||
|
Right, the new error clearly indicate that CN and SAN doesn't correspond to server host name. This is clearly an error on AWS side. | ||||||||||||||||||||||||
| Comment by Joseph Witthuhn [ 2017-08-29 ] | ||||||||||||||||||||||||
|
Just to follow up, AWS has finished up with their fix, and the 2.1.0 release code now can correctly validate our Aurora cluster hostnames (without this additional change). I also tested it again with the snapshot that you provided above, and confirmed that snapshot works as well (which makes sense, since in theory, it wouldn't hit the new code path). |