question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for trustServerCertificate flag

See original GitHub issue

Feature Request

Is your feature request related to a problem? Please describe

In mssql-jdbc library such option is simply available to developer but in r2dbc it needs some struggle (mostly finding out how to enable it) to use SSL with self signed cert.

Describe the solution you’d like

Add new configuration flag which would control trustServerCertificate parameter in underlying mssql-jdbc library. Best to create new parameter in MssqlConnectionConfiguration which would allow using self signed cert.

Describe alternatives you’ve considered

Using generic ConnectionFactoryOptions with adding custom Option but that in fact calls Mssql factory which omits it. After abnalyzing mssql-jdbc driver I found out that in case of using this flag it register dummy trust manager so I mimic that: configBuilder.sslContextBuilderCustomizer(b -> b.trustManager(TrustAllTrustManager.INSTANCE));

Teachability, Documentation, Adoption, Migration Strategy

MssqlConnectionConfiguration.builder().trustServerCertificate();

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
thankusWRcommented, Jan 28, 2021
0reactions
thankusWRcommented, Jan 28, 2021

Great thx, confirmed its ok. The only thing is that I needed to comment out javadocs generation from POM as it was failing:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  26.553 s
[INFO] Finished at: 2021-01-28T12:06:04+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:3.2.0:jar (attach-javadocs) on project r2dbc-mssql: MavenReportException: Error while generating Javadoc: 
[ERROR] Exit code: 1 - warning: unknown enum constant When.MAYBE
[ERROR]   reason: class file for javax.annotation.meta.When not found
[ERROR] javadoc: error - Error fetching URL: https://r2dbc.io/spec/0.9.0.BUILD-SNAPSHOT/api/
[ERROR] javadoc: error - The code being documented uses modules but the packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the unnamed module.
[ERROR] 
[ERROR] Command line was: <localPath>javadoc @options @packages
[ERROR] 
[ERROR] Refer to the generated Javadoc files in '<anotherLocalPath>r2dbc-mssql/target/apidocs' dir.
[ERROR] 
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Read more comments on GitHub >

github_iconTop Results From Across the Web

A connection was successfully established with the server, but ...
Data.SqlClient package, above error occurs no more and I don't have to inject TrustServerCertificate flag. 1) Can anyone let me know why this ......
Read more >
Support Encrypt flag when building DNS [#2691691] - Drupal
I've been tasked with updating the shared SQL server our drupal installation uses to enforced encryption/SSL, and am wondering if there should ...
Read more >
Using Encrypt=yes in a Sql Server connection string ...
I realize this is pretty old, but thought this might still help someone. ... option to add an "ignore this security warning flag"...
Read more >
Connection Failures with Microsoft.Data.SqlClient 4 and later
So I just ran into an annoying issue while upgrading to the Microsoft.Data.SqlClient version 4.0.0 . I've been running version 3.0.1 and ...
Read more >
How to set and use encrypted SQL Server connections
Enable ForceEncryption option in Flags tab, ... Confirm the settings and restart the SQL Server service to apply changes. ... Add($check).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found