> On Nov. 7, 2017, 12:06 p.m., Velmurugan Periasamy wrote: > > kms/src/main/java/org/apache/hadoop/crypto/key/RangerKMSDB.java > > Line 144 (original), 143 (patched) > > <https://reviews.apache.org/r/63575/diff/1/?file=1881353#file1881353line144> > > > > Can you please clarify this assertion that "updateDBSSLURL function is > > never called, because getDBFlavor always return DB_FLAVOR_UNKNOWN" ? > > Because I see that checks are done with containsIgnoreCase. At least one > > of these properties DB_DIALECT, DB_DRIVER or DB_URL should contain the > > string containing db flavor. SSL case is only for MYSQL.
The problem is that, in the getDBFlavor method, the code is calling DB_PROPERTIES.get(propertyName) instead of newConfig.get(propertyName) The first only contains javax.persistence.jdbc.dialect, javax.persistence.jdbc.driver, javax.persistence.jdbc.url, javax.persistence.jdbc.user and javax.persistence.jdbc.password, but in the loop it is checking ranger.ks.jpa.jdbc.dialect, ranger.ks.jpa.jdbc.driver, ranger.ks.jpa.jdbc.url. So none will ever match - Zsombor ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/63575/#review190293 ----------------------------------------------------------- On Nov. 6, 2017, 10:22 a.m., Zsombor Gegesy wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/63575/ > ----------------------------------------------------------- > > (Updated Nov. 6, 2017, 10:22 a.m.) > > > Review request for ranger. > > > Bugs: RANGER-1873 > https://issues.apache.org/jira/browse/RANGER-1873 > > > Repository: ranger > > > Description > ------- > > In RangerKMSDB, the updateDBSSLURL function is never called, because > getDBFlavor always return DB_FLAVOR_UNKNOWN, because it tries to read from > DB_PROPERTIES, instead of the configuration. The DB_PROPERTIES only contains > - at that point values for the keys: > PROPERTY_PREFIX+DB_DIALECT,PROPERTY_PREFIX+DB_DRIVER,PROPERTY_PREFIX+DB_URL. > > Fixed this issue, moved the DB_PROPERTIES static variable to an instance > variable, and simplified the string manipulation code a bit > > > Diffs > ----- > > kms/src/main/java/org/apache/hadoop/crypto/key/RangerKMSDB.java 649da30c5 > > > Diff: https://reviews.apache.org/r/63575/diff/1/ > > > Testing > ------- > > https://travis-ci.org/gzsombor/ranger/builds/297898874 > > > Thanks, > > Zsombor Gegesy > >
