title: JDBC connection pool ping error in Glassfish
body: <p>I am trying to create a jdbc connection pool in glassfish 5 for a Microsoft SQL Server database. I am using the <code>mssql-jdbc-6.2.2.jre8.jar</code> and the latest SQLExpress server version (MSSQL14.SQLEXPRESS)</p>
  
  <p>Resource Type: <code>javax.sql.DataSource</code></p>
  
  <p>Datasource Classname: <code>com.microsoft.sqlserver.jdbc.SQLServerDataSource</code></p>
  
  <p><a href="https://i.stack.imgur.com/7Sse7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Sse7.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/7H5uO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7H5uO.png" alt="enter image description here"></a>
  The connection pool is created successfully but when i try to ping, I get this error:</p>
  
  <blockquote>
    <p>Ping Connection Pool failed for sql_tire_pool. Connection could not be
    allocated because: The driver could not establish a secure connection
    to SQL Server by using Secure Sockets Layer (SSL) encryption. Error:
    "Unsupported curveId: 29".
    ClientConnectionId:f86f1ef8-29c4-4e39-b112-f5da9cbfe13d Please check
    the server.log for more details.</p>
  </blockquote>
  
  <p>And this is the server log:</p>
  
  <blockquote>
    <p>[2017-10-11T10:55:11.747+0300] [glassfish 5.0] [WARNING]
    [test.connection.pool.failed]
    [javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.service]
    [tid: _ThreadID=125 _ThreadName=admin-listener(7)] [timeMillis:
    1507708511747] [levelValue: 900] [[   RAR8054: Exception while
    creating an unpooled [test] connection for pool [ test_pool ],
    Connection could not be allocated because: The driver could not
    establish a secure connection to SQL Server by using Secure Sockets
    Layer (SSL) encryption. Error: "Unsupported curveId: 29".
    ClientConnectionId:4c325981-4c97-4db2-b4fb-f7aafca4f03b]]</p>
    
    <p>[2017-10-11T10:55:11.750+0300] [glassfish 5.0] [SEVERE] []
    [org.glassfish.admingui] [tid: _ThreadID=51
    _ThreadName=admin-listener(3)] [timeMillis: 1507708511750] [levelValue: 1000] [[   RestResponse.getResponse() gives FAILURE. 
    endpoint =
    '<a href="http://localhost:4848/management/domain/resources/ping-connection-pool.json" rel="nofollow noreferrer">http://localhost:4848/management/domain/resources/ping-connection-pool.json</a>';
    attrs = '{id=test_pool}']]</p>
  </blockquote>
  
  <p>I am running Windows 10 and also everything is running locally (Glassfish installation, SQL server)</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Using the accepted answer's solution, the problem is partially solved.The connection pool now successfuly pings the database, but I encounter the same problem as the same error is thrown in the glassfish log when my application tries to run a query through jpa/hibernate.</p>