Skip to content

Fix issue with truststore password being removed too early for XA transaction#1133

Merged
peterbae merged 16 commits intomicrosoft:devfrom
peterbae:PKCS12-fix
Sep 27, 2019
Merged

Fix issue with truststore password being removed too early for XA transaction#1133
peterbae merged 16 commits intomicrosoft:devfrom
peterbae:PKCS12-fix

Conversation

@peterbae
Copy link
Copy Markdown
Contributor

The creation of an SQLServerXAConnection requires two connections to be made, one for the transaction and one for the control connection. However, after the creation of the transaction connection, truststore password is removed (for security purposes), and this prevents the control connection from being established successfully. The problem occurs if the truststore is password protected.

My solution temporarily re-adds the truststore password to the driver's list of properties between the time when a transaction connection is made and the control connection is made (the password will still be removed after the control connection is established). I've tested against both cases where the user provides the truststore password through the DataSource or from the connection property.

@peterbae
Copy link
Copy Markdown
Contributor Author

Adding the driver jar with the solution (Java 8/Java 12) for testing.

github-PR-1133-fix.zip

@ulvii ulvii added this to the 7.5.0 milestone Sep 13, 2019
lilgreenbird
lilgreenbird previously approved these changes Sep 23, 2019
rene-ye
rene-ye previously approved these changes Sep 23, 2019
@peterbae peterbae dismissed stale reviews from rene-ye and lilgreenbird via 5088fcb September 25, 2019 23:40
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/connection/XADataSourceTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/jdbc/connection/XADataSourceTest.java Outdated
Comment thread src/test/java/com/microsoft/sqlserver/testframework/Constants.java Outdated
ulvii
ulvii previously approved these changes Sep 26, 2019
@peterbae peterbae merged commit 8e61500 into microsoft:dev Sep 27, 2019
ulvii added a commit that referenced this pull request Oct 16, 2019
* Release | Update SNAPSHOT for 7.5.0-preview release (#1129)

* Release | Update driver version

* Release| Add pom and gradle files

* Fix | Remove extra spaces in SQLServerDatabaseMetaData.getNumericFunctions()/SQLServerDatabaseMetaData.getStringFunctions() return values (#1117)

* Tests | Improve assertions in ComparisonUtil (#1100)

* ComparisonUtil : replace assertTrue with assertEquals

Failure message should include the actual/expected values and that is what assertEquals does.

* Corrected BigDecimal comparison

Scale difference should be ignored.

* Fix | Add list of trusted endpoints for AKV (#1130)

* added list of trusted endpoints

* rename

* Update issue templates (#1148)

* Fix getImportedKeys() returning duplicate rows if multiple FKs have the same name  (#1092)

* fixed for github #1091 dup rows

* Fix STAsBinary returning null for a single point (#1074)

* populate wkb for point

* fix stasbinary issue

* change variable name

* apply same variable name change

* Performance | Improved performance of column name string lookups (#1066)

* Fix | Made column name lookup more performant

* Fix | Spacing

* Fix | Changed arraylist to maps

* Fix | Add newline

* Add | Caching for previously retrieved columns

* Fix | Formatting

* Fix | Variable issue

* Fix | null order

* Fix | part 2

* Revert | Integer changes

* Fix | Trim retrieved column name

* Fix | Clear column names whenever ResultSet cursor is moved

* Revert "Fix | Clear column names whenever ResultSet cursor is moved"

This reverts commit db42d44.

* Add | Implement hashCode() and equals() APIs for SQLServerDataTable and SQLServerDataColumn (#1146)

* Add | Add hashCode()/equals() methods to SQLServerDataColumn and SQLServerDataTable

* Fix issue with truststore password being removed too early for XA transaction (#1133)

Fix | Fix issue with truststore password being removed too early for XA transaction

* Fix | SQLServerDatabaseMetada.getColumns not escaping wildcard (#1138)

* Feature | Introduce JAVA 13 Support (#1151)

* JDK 13 | Remove jre12 from pom file

* JDK 13 | Update Gradle build file

* JDK 13 | Update Azure-pipelines

* Test | Updated SQL Server from 2008R2 to 2012 in CI (#1153)

* Performance | Disabled pattern matching when using CallableStatements and SQLServerParameterMetaData (#1149)

* Fix | Added ISQLServerBulkData to remove implementation details from ISQLServerBulkRecord (#1099)

* Feature | Added support for Always Encrypted with Secure Enclaves (#1155)

* Release | 8.1.0-preview release changes (#1158)
ulvii pushed a commit that referenced this pull request Mar 3, 2020
…nsaction (#1133)

Fix | Fix issue with truststore password being removed too early for XA transaction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants