Yeah, that proves my doubt that, are you sure using such trustServerCertificate method works for JMeter at all?
So, my advice, - Try connect to your azure Database with MS SQL server client itself using the SQL authentication (user/password) first - If it works, replace your jdbc sqlserver connection string with the SQL authentication (user/password) and try again On Mon, Jun 13, 2022 at 10:49 AM Jun Zhuang <thornbird...@yahoo.com> wrote: > > Hi thanks for the quick response. That did not do anything - as a matter > of fact, I got the same error even if I provide an invalid trustStore path. > which makes me wonder if the solution provided by MS is valid in this case > or where exactly is JM looking for the cacerts file? > On Monday, June 13, 2022, 10:32:37 AM EDT, Tong Sun <suntong...@gmail.com> > wrote: > > > Hi, just shooting in the dark, have you tried to replace the backslash "\" > with forward-slash "/" for your "C:\..." path? > > On Mon, Jun 13, 2022 at 10:20 AM Jun Zhuang < > thornbird...@yahoo.com.invalid> > wrote: > > > Hi my fellow JMeter users, > > I am having trouble connecting to MS SQL server DB, I wonder if I can get > > some pointers? > > JDBC Driver class: com/Microsoft.sqlserverjdbc.SQLServerDriver.Driver was > > downloaded from Microsoft site and the jar file copied to JMeter’slib > dir. > > 1. Initial Error when using Database URL: > > jdbc:sqlserver://${DatabaseServer};databaseName=${DatabaseName}; > > java.sql.SQLException: Cannot createPoolableConnectionFactory (The driver > > could not establish a secure connectionto SQL Server by using Secure > > Sockets Layer (SSL) encryption. Error: > > "sun.security.validator.ValidatorException: PKIXpath building > > failed:sun.security.provider.certpath.SunCertPathBuilderException: unable > > to findvalid certification path to requested > > target".ClientConnectionId:f5802381-3429-45d2-830d-8b64a44c1f44) > > 2. Database URL based on a MS article ( > > > https://techcommunity.microsoft.com/t5/azure-database-support-blog/pkix-path-building-failed-unable-to-find-valid-certification/ba-p/2591304): > jdbc:sqlserver://${DatabaseServer};databaseName=${DatabaseName};trustServerCertificate=false;trustStore="C:\Program > > Files > > > (x86)\Java\jre1.8.0_333\lib\security\cacerts";trustStorePassword=changeit; > > java.sql.SQLException: Cannot createPoolableConnectionFactory (The driver > > could not establish a secure connectionto SQL Server by using Secure > > Sockets Layer (SSL) encryption. Error: "java.lang.RuntimeException: > > Unexpected error: java.security.InvalidAlgorithmParameterException:the > > trustAnchors parameter must be > > non-empty".ClientConnectionId:147ec91d-1b27-4073-9306-61c2fe934840) > > I made sure the trustStore path in the URL was correct and cacerts was > > valid. > > In both cases, I provided the username and password for the JDBC > > Connection Configuration. > > I have tried many things I found on the Internet regarding the error in > > the 2nd scenario but none worked. > > Appreciate any input. > > Jun >