title: Unable to Connect to Azure SQL-Server: sun.security.validator.ValidatorException
body: <p>Created an Azure SQL server machine and I am able to rdp as well as connect via the local SQL Server Mgt Studio client. </p>
  
  <p>However I cannot connect to the same instance via Java code using the connection string further below. </p>
  
  <ul>
  <li>I am using  the latest JDBC Driver (Microsoft JDBC Driver 7.4)</li>
  <li>I am using SQL Server 2017 Express</li>
  <li>I am able to connect manually via SQL Server Mgt Studio client on local machine</li>
  </ul>
  
  <p>Here is the error message:</p>
  
  <blockquote>
    <p>com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not
    establish a secure connection to SQL Server by using Secure Sockets
    Layer (SSL) encryption. Error:
    "sun.security.validator.ValidatorException: PKIX path building failed:
    sun.security.provider.certpath.SunCertPathBuilderException: unable to
    find valid certification path to requested target".
    ClientConnectionId:xxxxxxxxxxxxxxxxxx</p>
  </blockquote>
  
  <p>Here is the connection string:</p>
  
  <blockquote>
    <p>jdbc:sqlserver://Server=nn.nnn.nnn.nnn;Integrated Security=false;User
    ID=myusername;Password=mypassword</p>
  </blockquote>
  
  <p>Thanks for your help!</p>