# Unable to connect to database. The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption

**URL:** <https://discuss.elastic.co/t/unable-to-connect-to-database-the-driver-could-not-establish-a-secure-connection-to-sql-server-by-using-secure-sockets-layer-ssl-encryption/240562>\
**Category:** Logstash\
**Created:** [July 9, 2020, 4:09pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-database-the-driver-could-not-establish-a-secure-connection-to-sql-server-by-using-secure-sockets-layer-ssl-encryption/240562 "2020-07-09T16:09:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Foxis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_foxis/32/69811_2.png) [@Andrew\_Foxis](https://discuss.elastic.co/u/Andrew_Foxis)\
**Post date:** [July 9, 2020, 4:09pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-database-the-driver-could-not-establish-a-secure-connection-to-sql-server-by-using-secure-sockets-layer-ssl-encryption/240562/1 "2020-07-09T16:09:51Z")

</div>

Hi all!

I configure connect to database jdbc and get error(

```auto
[2020-07-09T19:07:06,569][ERROR][logstash.inputs.jdbc] Unable to connect to database. Tried 1 times {:error_message=>"Java::ComMicrosoftSqlserverJdbc::SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: \"java.security.cert.CertificateException: Certificates do not conform to algorithm constraints\".

```

How fix it? Thanks

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [July 9, 2020, 4:41pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-database-the-driver-could-not-establish-a-secure-connection-to-sql-server-by-using-secure-sockets-layer-ssl-encryption/240562/2 "2020-07-09T16:41:34Z")

</div>

> [@Andrew\_Foxis](#):
>
> `Certificates do not conform to algorithm constraints`

The server certificate (or a certificate used to sign that certificate) has a very weak hash algorithm, or a key length so short that that makes it weak. Without seeing all the details of the certs we cannot say which.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 6, 2020, 4:50pm UTC](https://discuss.elastic.co/t/unable-to-connect-to-database-the-driver-could-not-establish-a-secure-connection-to-sql-server-by-using-secure-sockets-layer-ssl-encryption/240562/3 "2020-08-06T16:50:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
