{"id":136,"date":"2022-03-09T14:51:11","date_gmt":"2022-03-09T11:51:11","guid":{"rendered":"https:\/\/www.gmerden.com\/?p=136"},"modified":"2026-01-31T21:15:23","modified_gmt":"2026-01-31T21:15:23","slug":"mssql-net6-0-provider-ssl-provider-error-31-encryptionssl-tls-handshake-failed-on-ubuntu","status":"publish","type":"post","link":"https:\/\/www.gmerden.com\/index.php\/2022\/03\/09\/mssql-net6-0-provider-ssl-provider-error-31-encryptionssl-tls-handshake-failed-on-ubuntu\/","title":{"rendered":"MSSQL, Net6.0, (provider: SSL Provider, error: 31 &#8211; Encryption(ssl\/tls) handshake failed) on Ubuntu"},"content":{"rendered":"\n<p>I am trying to connect different versions of MSSQL which is not support TLSv1.2. So i searched on internet and found something useful.<\/p>\n\n\n\n<p>First of all, which error occured , lets talk about it<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 31 - Encryption(ssl\/tls) handshake failed)\n ---&gt; System.IO.IOException:  Received an unexpected EOF or 0 bytes from the transport stream.\n   at System.Net.Security.SslStream.ReceiveBlobAsync&#91;TIOAdapter](TIOAdapter adapter)\n   at System.Net.Security.SslStream.ForceAuthenticationAsync&#91;TIOAdapter](TIOAdapter adapter, Boolean receiveFirst, Byte&#91;] reAuthenticationData, Boolean isApm)\n   at System.Net.Security.SslStream.AuthenticateAsClient(SslClientAuthenticationOptions sslClientAuthenticationOptions)\n   at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)<\/code><\/pre>\n\n\n\n<p>After i saw error and some search changed opensll.cnf<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.gmerden.com\/wp-content\/uploads\/2022\/03\/resim.png\"><img decoding=\"async\" src=\"https:\/\/www.gmerden.com\/wp-content\/uploads\/2022\/03\/resim.png\" alt=\"\" class=\"wp-image-137\"\/><\/a><\/figure>\n\n\n\n<p>I have changed MinProtocol From TLSv1.2 to TLSv1 and DEFAULT@SECLEVEL=2 to 1. Afterwards connection established<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>See you, G\u00f6khan<\/p>\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>I am trying to connect different versions of MSSQL which is not support TLSv1.2. So i searched on internet and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[3],"tags":[],"class_list":["post-136","post","type-post","status-publish","format-standard","hentry","category-software-development"],"_links":{"self":[{"href":"https:\/\/www.gmerden.com\/index.php\/wp-json\/wp\/v2\/posts\/136","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gmerden.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gmerden.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gmerden.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gmerden.com\/index.php\/wp-json\/wp\/v2\/comments?post=136"}],"version-history":[{"count":4,"href":"https:\/\/www.gmerden.com\/index.php\/wp-json\/wp\/v2\/posts\/136\/revisions"}],"predecessor-version":[{"id":451,"href":"https:\/\/www.gmerden.com\/index.php\/wp-json\/wp\/v2\/posts\/136\/revisions\/451"}],"wp:attachment":[{"href":"https:\/\/www.gmerden.com\/index.php\/wp-json\/wp\/v2\/media?parent=136"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gmerden.com\/index.php\/wp-json\/wp\/v2\/categories?post=136"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gmerden.com\/index.php\/wp-json\/wp\/v2\/tags?post=136"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}