Skip to content
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

Trying to set trustServerCertificate true in schemaspy.connprops Property in config file does not work #1440

Open
xFichtl1 opened this issue Apr 18, 2024 · 2 comments

Comments

@xFichtl1
Copy link

When trying to use the property schemaspy.connprops trustServerCertificate\=true with the additional argument integratedSecurity\=true, the boolean value doesn't get correctly parsed (or something else, is just a guess). When appending an ';', the boolean value of trustServerCertificate gets ignored. When doing everything with command line arguments, it works.

Expected Behavior

Both arguments should work when using together

Current Behavior

Getting following error when not using ';':

Failed to connect to database URL [jdbc:sqlserver://localhost:1433;databaseName='myDbName'] The property integratedSecurity does not contain a valid boolean value. Only true or false can be used.

When using ';' as last character, I get the following error:

Failed to connect to database URL [jdbc:sqlserver://localhost:1433;databaseName='myDbName'] "encrypt" property is set to "true" and "trustServerCertificate" property is set to "false" but the driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption: Error: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target. ClientConnectionId:<some UUID>

Possible Solution

Not a solution but an alternative: Using command line arguments instead defining them in the config

java -jar C:\work\Tools\SchemaSpy\schemaspy-6.2.4.jar -t mssql08 -host localhost -port 1433 -db myDbName -o C:\Work\myProjet\databasediagrams\mySchema -dp "C:\work\Tools\sqljdbc_12.6\enu\jars\mssql-jdbc-12.6.1.jre11.jar" -s mySchema -vizjs -sso -connprops "integratedSecurity\=true;trustServerCertificate\=true"

Steps to Reproduce (for bugs)

Running following powershel script in powershell:

$javaExecutable = "java"
$schemaSpyJar = "C:\work\Tools\Schemaspy\schemaspy-6.2.4.jar"

$arguments = @(
    "-jar", $schemaSpyJar
)

& $javaExecutable $arguments

schemaspy.properties

# type of database
schemaspy.t=mssql08

# optional path to alternative jdbc drivers.
schemaspy.dp=C:/work/Tools/sqljdbc_12.6/enu/jars/mssql-jdbc-12.6.1.jre11.jar

# database properties: host, port number, name
schemaspy.host=localhost
schemaspy.port=1433
schemaspy.db='myDbName'

# additional connection string properties
schemaspy.connprops='trustServerCertificate\=true;integratedSecurity\=true;'

# db scheme for which generate diagrams
schemaspy.s=mySchema

# output dir to save generated files
schemaspy.o=C:/Work/Mambo/Datenbankdiagramm/Nora

# use single sign-on
schemaspy.sso

# use intergrated Viz.js
schemaspy.vizjs

Context

  • Database type (e.g. MySQL): MSSQL
  • Database driver version (is you use a special one): 12.6.1.jre11.jar
  • Your DDL (sample how to reproduce the issue): The one directly from Microsofts website
  • Full command including arguments how you run SchemaSpy:

Your Environment

  • Version used: 6.2.4
  • Environment name and version (e.g. Chrome 39): 5.1.22621.2506
  • Operating System and version (e.g. Windows 10): Windows 11
  • Java version: Temurin 21.0.2+13 LTS
@npetzall
Copy link
Member

Need to check what we have written in the documentation but looking att the source code.

It looks like you need \\= not \=

@npetzall
Copy link
Member

I might be totally in the wrong here. Since it's layers of escaping.

But it should be easy for us to create a test for this.

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

No branches or pull requests

2 participants