Search code examples
sql-serverjdbcartifactorymssql-jdbc

Microsoft SQL server as Atrifactory 7.38.10 metadata database


We have installed Atrifactory 7.38.10 on a windows server, Microsoft SQL server configured in System.yml as a database for metadata.

String connectionUrl =
    "jdbc:sqlserver://localhost:1433;" +
     "databaseName=AdventureWorks;integratedSecurity=true;" +
     "encrypt=true;trustServerCertificate=true";

Artifactory.bat start throwing below mentioned error.

  • Could not initialize database (db config: {mssql jdbc:sqlserver://dev.tfs2017sql.xyz.com:55300;databaseName=JFROGPOC;encrypt=false;sendStringParametersAsUnicode=false;applicationName=Artifactory Binary Repository;integratedSecurity=true;}): TLS Handshake failed: x509: certificate signed by unknown authority error connecting to database. giving up jfrog.com/metadata/v7/services/common/db.(*databaseBearer).init jfrog.com/metadata/v7@v7.37.0/services/common/db/database_bearer.go:152

Java version is 11 and JDBC driver is “mssql-jdbc_auth-10.2.1.x64.dll” for windows integrated authentication


Solution

  • From the way it looks, the issue is on the metadata service as you said. I suggest trying to follow this article I wrote in the past about it and try to provide to the metadata service an additional golang connection URL(as it's possible that the script conversion from the Java doesn't support all the parameters), and make sure you have added the certificate to the /etc/ssl/certs folder as metadata service is written in Golang and usually load the certificates from the OS and not from the Java trust store.