Ошибка безопасности ssl microsoft ole db

This article, suggests a way of resolving the below error message, when you are trying to access SQL Server using “Microsoft OLE DB Provider for SQL Server” and TLS 1.0: [DBNETLIB] [ConnectionOpen (SECDoClientHandshake()).] SSL Security Error

Prior to start writing this article, I was thinking of using a title like “How to still use TLS 1.0”, or something similar, but besides the fact that would have given a wrong message, it would not help so much because many people, usually search for such articles using the error message (SSL Security error)…

So, I anticipate that this article, with this title, would help as many people as possible 🙂

Drop me a line if you find the article useful and why not, subscribe to my newsletter to stay up to date with future articles!

A Few Words About TLS 1.0

TLS 1.0 is considered a deprecated protocol and it is not recommended anymore to be used to secure connections. That’s why many organizations (if not all) transitioned or are in the process of transitioning to newer versions of TLS such as TLS1.1 or above.

However, you may still encounter outdated applications that still need to use this protocol, even for a while for just performing a single operation. One such example, is to try and connect to a SQL Server instance via Microsoft OLE DB Driver for SQL Server using TLS 1.0.

If you are in such situation, I have good news, from a technical aspect, it is still possible to do this.

Read on to learn more.

SQL Server Support for TLS 1.0 and Above

SQL Server still supports all TLS protocols, currently from 1.0 to 1.2. However, depending on the version of SQL Server you have, especially in cases of older SQL Server versions, you might need a patch.

Read this article on SQLNetHub to learn more about SQL Server support for TLS versions.

Now let’s jump to the juicy part of this article and see how finally we can resolve the above error and manage to connect to SQL Server using Microsoft OLE DB Driver for SQL Server and TLS 1.0.

Note that if you are just trying to connect with TLS 1.0 for a while in order to perform a specific task, then make sure to revert the below changes in order to restore the security level of your systems back to their previous level.

Latest Microsoft OLE DB Driver for SQL Server

The first step towards resolving the SSL Security error, is to make sure that the version of the target SQL Server instance you want to connect to, is supported by the driver.

For example, Microsoft OLE DB Driver 18.1 for SQL Server supports connecting to SQL Server 2012 or later.

For older versions of SQL Server, you will need to find an earlier version of Microsoft OLE DB Provider for SQL Server as well.

You can find the latest version of the OLE DB driver here.

Useful details:

The Microsoft OLE DB Provider for SQL Server, allows ADO to access Microsoft SQL Server. However, This is an older driver and it is not recommended to be used driver for new development, since it is deprecated.

The new OLE DB provider is called the Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL) which will be updated with the most recent server features going forward (learn more)

Registry Changes

The next step is, to edit the Windows Registry (always be careful when messing up with Windows Registry – only certified engineers should do that).

To enable TLS 1.0 in Windows

In Windows Registry, add the below dword keys:

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Server]

  • “Enabled”=dword:00000001
  • “DisabledByDefault”=dword:00000000

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Client]

  • “Enabled”=dword:00000001
  • “DisabledByDefault”=dword:00000000

To disable TLS 1.0 in Windows

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Server]

  • “Enabled”=dword:00000000
  • “DisabledByDefault”=dword:00000001

[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Client]

  • “Enabled”=dword:00000000
  • “DisabledByDefault”=dword:00000001

Learn more about the above registry changes in this MS Docs article.

Local Security Policy

The next step is to check the Local Security Policy on the database server.

So, in Local Security Policy on the Database Server, make sure that the setting “System Cryptography: Use FIPS compliant algorithms for encryption, hashing, and signing” is disabled.

If you want to learn more about this security option, you can check this MS Docs article.


Strengthen your SQL Server Administration Skills – Enroll to our Online Course!

Check our online course on Udemy titled “Essential SQL Server Administration Tips
(special limited-time discount included in link).

Via the course, you will learn essential hands-on SQL Server Administration tips on SQL Server maintenance, security, performance, integration, error handling and more. Many live demonstrations and downloadable resources included!

Essential SQL Server Administration Tips - Online Course with Live Demonstrations and Hands-on Guides

(Lifetime Access/ Live Demos / Downloadable Resources and more!)

Enroll from $12.99


Server Protocols, Ciphers, Hashes and Client Protocols

The last step in this troubleshooting guide, is to use IISCrypto, which is an excellent free tool, that allows you to control which protocols, ciphers, and more are enabled (or not) on a Windows server.

That being set, you will need to run IISCrypto and make sure that the “TLS 1.0” Server and Client Protocols, as well as the”SHA” hash are enabled.

Here’s a screenshot of IISCrypto, running on my PC, having TLS 1.0 and “SHA” enabled for illustration purposes:

[DBNETLIB] [ConnectionOpen (SECDoClientHandshake()).] SSL Security Error - How to Resolve - Article on SQLNetHub

Note that, if finally you need to perform any changes using IISCrypto, you will need to restart the server.

Actually, for any changes you might need to perform, it is recommended to restart the server.

A Piece of Advice

As mentioned in this article’s beginning, TLS 1.0 is considered a deprecated protocol and it is not recommended anymore to be used to secure connections.

Instead, you should be using newer versions of TLS.

In case you just need to switch to TLS 1.0 for performing an ad hoc task, you need to make sure that after you completed the task, you revoked any changes you might have applied, and disable again TLS 1.0 and the “SHA” hash.

See More

Check out DBA Security Advisor, a SQL Server security tool to assess your SQL Server instances against a rich set of security checks and get security best practice recommendations.

Featured Online Courses:

  • SQL Server 2022: What’s New – New and Enhanced Features 
  • Data Management for Beginners – Main Principles
  • Introduction to Azure Database for MySQL
  • Working with Python on Windows and SQL Server Databases
  • Boost SQL Server Database Performance with In-Memory OLTP
  • Introduction to Azure SQL Database for Beginners
  • Essential SQL Server Administration Tips
  • SQL Server Fundamentals – SQL Database for Beginners
  • Essential SQL Server Development Tips for SQL Developers
  • Introduction to Computer Programming for Beginners
  • .NET Programming for Beginners – Windows Forms with C#
  • SQL Server 2019: What’s New – New and Enhanced Features
  • Entity Framework: Getting Started – Complete Beginners Guide
  • A Guide on How to Start and Monetize a Successful Blog
  • Data Management for Beginners – Main Principles

Read Also

  • DBA Security Advisor v2.3 is Now Out!
  • The OLE DB provider “SQLNCLI11” for linked server “…” supplied inconsistent metadata for a column… – How to Resolve
  • SQL Server 2022: What’s New – New and Enhanced Features (Course Preview)
  • How to Connect to SQL Server Databases from a Python Program
  • What is Data Security and which are its Main Characteristics?
  • Introduction to Azure Database for MySQL (Course Preview)
  • Data Management for Beginners – Main Principles (Course Preview)
  • Advanced SQL Server Features and Techniques for Experienced DBAs
  • SQL Server Database Backup and Recovery Guide

Other SQL Server Security-Related Articles

  • How to Enable SSL Certificate-Based Encryption on a SQL Server Failover Cluster
  • Why You Need to Secure Your SQL Server Instances
  • Policy-Based Management in SQL Server
  • Advanced SQL Server Features and Techniques for Experienced DBAs
  • Should Windows “Built-InAdministrators” Group be SQL Server SysAdmins?
  • Frequent Password Expiration: Time to Revise it?
  • The “Public” Database Role in SQL Server
  • Encrypting SQL Server Databases
  • 10 Facts About SQL Server Transparent Data Encryption
  • Encrypting a SQL Server Database Backup
  • …check all

Subscribe to our newsletter and stay up to date!

Subscribe to our YouTube channel (SQLNetHub TV)

Easily generate snippets with Snippets Generator!

Secure your databases using DBA Security Advisor!

Generate dynamic T-SQL scripts with Dynamic SQL Generator!

Check our latest software releases!

Check our eBooks!

Rate this article: 1 Star2 Stars3 Stars4 Stars5 Stars (8 votes, average: 5.00 out of 5)

Loading… 

Reference: SQLNetHub.com (https://www.sqlnethub.com)

© SQLNetHub

Artemakis Artemiou

Artemakis Artemiou is a Senior SQL Server Architect, Author, a 9 Times Microsoft Data Platform MVP (2009-2018). He has over 20 years of experience in the IT industry in various roles. Artemakis is the founder of SQLNetHub and {essentialDevTips.com}. Artemakis is the creator of the well-known software tools Snippets Generator and DBA Security Advisor. Also, he is the author of many eBooks on SQL Server. Artemakis currently serves as the President of the Cyprus .NET User Group (CDNUG) and the International .NET Association Country Leader for Cyprus (INETA). Moreover, Artemakis teaches on Udemy, you can check his courses here.

Views: 24,707

Tasks using ‘Microsoft OLE DB Provider for SQL Server’ are failing with the following error:

Possible Error 1: 
Error: Connector connect error: ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: [DBNETLIB][ConnectionOpen (SECCreateCredentials()).]SSL Security error.

Possible Error 2:

ErrorMsg: [DBNETLIB][ConnectionOpen (SECDoClientHandshake()).]SSL Security error.

Environment: 

  • All QlikView versions
  • All Qlik Sense versions

Resolution:

The source and destination servers do not have aligned TLS versions enabled.

For example, if the data source only has TLS 1.0 enabled, while the Qlik product is installed on a Windows 2016 machine that disallows 1.0 and uses either TLS 1.1 or TLS 1.2, then the data source needs to be upgraded to support TLS 1.1 or TLS 1.2, or the security protocols need to be aligned. 

In this example, the currently deployed Microsoft OLE DEB Providers for SQL do not support TLS 1.2 yet. 

Please verify what version you have installed and confirm if you need to upgrade your data source: https://support.microsoft.com/en-us/kb/3135244 

Recommended Fix:

Upgrade your data source so that the TLS versions between the data source and Qlik Sense or QlikView server match.

Alternative Fix:

Align the TLS versions used. Note that the example we use here configures TLS 1.0. We do not recommend the use of TLS 1.0, it is simply used for demonstration purposes.

If the registry keys are not present, the script under the following article should add them leaving only TLS 1.2 enabled TLS and SSL Support in Qlik Sense: How to configure Qlik Sense and TLS . Then TLS 1.0 may be enabled as mentioned below.

TLS 1.0 can be enabled with the following registry changes:

  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Server] «Enabled»=dword:00000001
  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Server] «DisabledByDefault»=dword:00000000
  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Client] «Enabled»=dword:00000001
  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Client] «DisabledByDefault»=dword:00000000

EnableTLS1.0.gif

If the organization policy requires TLS 1.1 to be disabled, this can be done after the installation completes:

  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Server] «Enabled»=dword:00000000
  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Server] «DisabledByDefault»=dword:00000001
  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Client] «Enabled»=dword:00000000
  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Client] «DisabledByDefault»=dword:00000001

Related Content:

  • TLS and SSL Support in Qlik Sense: How to configure Qlik Sense and TLS 

YouTube Video (Better Quality)

I was approached with a case where the customer was trying to create a Data Source within the Power BI Admin Center and received the following error when trying to test the connection and having Encrypt Connection selected.

SNAGHTMLc6d9932

Artemakis Artemiou is a Senior SQL Server Architect, Author, a 9 Times Microsoft Data Platform MVP (2009-2018). He has over 20 years of experience in the IT industry in various roles. Artemakis is the founder of SQLNetHub and {essentialDevTips.com}. Artemakis is the creator of the well-known software tools Snippets Generator and DBA Security Advisor. Also, he is the author of many eBooks on SQL Server. Artemakis currently serves as the President of the Cyprus .NET User Group (CDNUG) and the International .NET Association Country Leader for Cyprus (INETA). Moreover, Artemakis teaches on Udemy, you can check his courses here.

Views: 24,707

Tasks using ‘Microsoft OLE DB Provider for SQL Server’ are failing with the following error:

Possible Error 1: 
Error: Connector connect error: ErrorSource: Microsoft OLE DB Provider for SQL Server, ErrorMsg: [DBNETLIB][ConnectionOpen (SECCreateCredentials()).]SSL Security error.

Possible Error 2:

ErrorMsg: [DBNETLIB][ConnectionOpen (SECDoClientHandshake()).]SSL Security error.

Environment: 

  • All QlikView versions
  • All Qlik Sense versions

Resolution:

The source and destination servers do not have aligned TLS versions enabled.

For example, if the data source only has TLS 1.0 enabled, while the Qlik product is installed on a Windows 2016 machine that disallows 1.0 and uses either TLS 1.1 or TLS 1.2, then the data source needs to be upgraded to support TLS 1.1 or TLS 1.2, or the security protocols need to be aligned. 

In this example, the currently deployed Microsoft OLE DEB Providers for SQL do not support TLS 1.2 yet. 

Please verify what version you have installed and confirm if you need to upgrade your data source: https://support.microsoft.com/en-us/kb/3135244 

Recommended Fix:

Upgrade your data source so that the TLS versions between the data source and Qlik Sense or QlikView server match.

Alternative Fix:

Align the TLS versions used. Note that the example we use here configures TLS 1.0. We do not recommend the use of TLS 1.0, it is simply used for demonstration purposes.

If the registry keys are not present, the script under the following article should add them leaving only TLS 1.2 enabled TLS and SSL Support in Qlik Sense: How to configure Qlik Sense and TLS . Then TLS 1.0 may be enabled as mentioned below.

TLS 1.0 can be enabled with the following registry changes:

  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Server] «Enabled»=dword:00000001
  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Server] «DisabledByDefault»=dword:00000000
  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Client] «Enabled»=dword:00000001
  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.0Client] «DisabledByDefault»=dword:00000000

EnableTLS1.0.gif

If the organization policy requires TLS 1.1 to be disabled, this can be done after the installation completes:

  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Server] «Enabled»=dword:00000000
  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Server] «DisabledByDefault»=dword:00000001
  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Client] «Enabled»=dword:00000000
  • [HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSecurityProvidersSCHANNELProtocolsTLS 1.1Client] «DisabledByDefault»=dword:00000001

Related Content:

  • TLS and SSL Support in Qlik Sense: How to configure Qlik Sense and TLS 

YouTube Video (Better Quality)

I was approached with a case where the customer was trying to create a Data Source within the Power BI Admin Center and received the following error when trying to test the connection and having Encrypt Connection selected.

SNAGHTMLc6d9932

Failed to test connection. [DBNETLIB][ConnectionOpen(SECDoClientHandshake()).]SSL Security error.

When we get an SSL error, we are talking about Certificates and trying to encrypt traffic between the client and the Data Source.  The client in this case will be the Data Management Gateway.

While we are using Power BI, this is a great example of just a regular connectivity issue.  This is not a Power BI specific issue.  We would get a failure in a different application as well, such as Management Studio.

They were using the Microsoft OLE DB Provider for SQL Server as the provider.  This is a really old provide and we should move to the .NET Provider or SQL Server Native Client if possible.  Although depending on how you pulled information into Excel, that may be the provider listed and we need to match that as I’ve described in other blogs.

One of the reasons I recommend moving off of it is due to the error message itself.  The OLE DB Provider error is fairly generic and not overly helpful.  With the .NET Provider and SQL Server Native Client, the messaging has been updated and can give you more details.  Here is what the error is from the SQL Server Native Client.

SNAGHTMLc7bd9e0

SSL Provider: The certificate chain was issued by an authority that is not trusted.

This is due to the certificate that SQL Server is presenting.  Based on the information in the certificate, and the certificate is invalid.  This can happen for multiple reasons.  In this case the error indicates that it was because we don’t trust the certificate, which is a fairly specific error versus the generic error from the OLE DB Provider.

How to correct it

To correct this, we have to deal with certificates.  In our case, the certificate used by the SQL Server is not within the Trusted Root Certification Authorities store of the machine running the Data Management Gateway.

To review the Trusted Root store, we can use MMC to do this.  Open MMC and add the Certificates Snap In. 

SNAGHTMLc94a74e

When you add that, you’ll presented with a dialog about how you want to manage certificates.  In what context?  You have three options:  My user account, Service account and Computer account.

SNAGHTMLc95f77c

I always use the Computer account context.  This will cover everything on the machine.  If you use My user account, it will be for your specific user.  So, Management Studio would start working, but the Data Management Gateway would still fail as that doesn’t run under your user account.  There are reasons why you would want to do either a service account or your user, but you need to know what you are doing and what your scenario is to understand how things will be affected.  For the purposes of this walk through, I’m going with Computer account.

After we add the Snap In within MMC, we will see several folders.  There are two we want to focus on.  Personal and Trusted Root Certification Authorities.

SNAGHTMLc9d82d2

The Personal store is where the certificates reside that you can actually use.  The Trusted Root store are the items that we trust that could be part of the certificate chain.

For our purposes, and to correct the issue, we are interested in the Trust Root store.  When we select the Certificates folder under the Trusted Root, these are all of the Certification Authorities (CA) that we trust.  So, if any certificate originates from any of these, they will be trusted by the system.  VeriSign is an example of one that is in this folder.  So, any certificate that comes from VeriSign, we will trust because it is a known organization.

SNAGHTMLca08bad

What is missing here is the item that will cause us to trust the certificate that is being presented by SQL Server.  There are different ways to create a certificate.  You can generate a self signed certificate.  You can get a certificate from a known CA such as VeriSign.  Or your organization may have their own Certification Authority.  In my case, I did a self signed certificate.  There are also different ways to do that.  You can create it through IIS, but in my case I used makecert to generate it.  This can be found in the Windows SDK.

Here is the makecert command I used to generate the server certificate.

makecert -r -pe -n «CN=guyinacubesql.guyinacube.com» -b 01/01/2000 -e 01/01/2036 -eku 1.3.6.1.5.5.7.3.1 -ss my -sr localMachine -sky exchange -sp «Microsoft RSA SChannel Cryptographic Provider» -sy 12

There are a couple of things that are required here.  The eku parameter I used indicates it is a Server Certificate.  Also, the sky parameter indicates exchange.  These are both required.  This was run on the SQL Server.

I created the certificate and then exported it to a PFX file.  PFX includes the private key.  We really only need the public cert which could just be a CER file.  I always include Extended Properties on the export.

I then go to the machine running the Data Management Gateway, and within the MMC/Certificates window, we can right click on the Certificates folder under the Trusted Root store, right click, go to All Tasks and select Import.  We can enter the password for the PFX package and Include all extended properties.

SNAGHTMLca86a72

We then want to place the certificate within the Trusted Root Certification Authorities store.

SNAGHTMLca8e60b

Once all of that is done, we should see our certificate listed within the Trust Root store.

SNAGHTMLcaa6613

The key symbol on the Cert icon indicates that it has the Private key. You will notice that the others don’t have the private key, and that’s fine.  So, now if we go back and test the connection on the Data Source, it will connect successfully because we trust the CA.

SNAGHTMLcae1001

If we change the provider over to SQL Server Native Client 11, we will actually get another error.

SNAGHTMLcafd7e0

SSL Provider: The target principal name is incorrect.

SQL Server Native Client is a little more strict in its certificate validation. We used the NetBIOS name for the server name.  However the name in the Certificate is the Fully Qualified Domain Name (FQDN).  So, they don’t match.  If we change the server name to the FQDN, it will then work correctly.

SNAGHTMLcb1d71b

SNAGHTMLcb27109

We care about the Certificate Path

The reason this failed is because we didn’t trust the root CA.  This comes down to the Certification Path.  When you open a certificate, there will be a Certification Path tab.  For a self signed certificate, you will only have that certificate listed.

SNAGHTMLcb4cb16

You may have multiple items listed.  If there is a red X on any item here, then the certificate will not be trusted.  Here is an example of one that isn’t trusted.

SNAGHTMLcb5e725

That’s when we need to add that to the Trusted Root store, like we just did, to get it to be trusted. 

Domain Certificate

I mentioned that you could have a Certification Authority within your organization (such as your Domain).  I can create a Domain Certificate multiple ways, but the easiest way for me is to just do it on a machine that has IIS installed.  When you go to the server, and look at Server Certificates, an option on the left says Create Domain Certificate.

SNAGHTMLcb9abfd

When you create that certificate, you will see the CA Certificate as a root within the Certification Path tab.

SNAGHTMLcbbabb5

From the domain perspective, every machine joined to the domain will have that CA Certificate in the Trusted Root store, so no action is needed.  It would just work.

Adam W. Saxton | Microsoft Business Intelligence Support – Escalation Services@GuyInACube | Mixes | YouTube | Facebook.comguyinacube

My server is windows 2008 server r2.
I found the following error on my server after disable tls 1.0 and SSLv3.

[DBNETLIB][ConnectionOpen (SECCreateCredentials()).]SSL Security
error.

Currently, only TLS 1.2 is enabled on my server, and at the client side the TLS 1.2 is set on

Is it posible if [DBNETLIB] is running on TLS 1.2?

UditS's user avatar

UditS

1,93616 silver badges37 bronze badges

asked Apr 6, 2016 at 13:29

antah berantah's user avatar

2

There might be chances that ODBC 11.0 earlier version is been installed. In this case the connection string should be
Driver={ODBC Driver 11 for SQL Server};Server=myServerAddress;Database=myDataBase;Trusted_Connection=yes;

And also check TLS 1.2 is enabled

answered Dec 12, 2018 at 16:04

Vijay Dodamani's user avatar

After disabling TLS 1.0 and 1.1 on Windows Server 2016 we were able to get our ASP Classic scripts database connections working again in the following way:

  1. Download and install Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL)
  2. Replace Provider=SQLOLEDB; with Provider=MSOLEDBSQL; in all connection strings for the ASP Classic scripts
  3. Done! (no restart needed)

Note: The previous (same name but different abbreviation) Microsoft OLE DB Provider for SQL Server (SQLOLEDB) and SQL Server Native Client OLE DB provider (SQLNCLI) remains deprecated and it is not recommended to use either for new development work. (source)

answered Jan 12, 2022 at 13:25

Jonas Äppelgran's user avatar

I had to do several things. The server was Windows 2016 Standard testing with a .txt file I changed to .UDL. This server was trying to connect to our Sql Server 2008 R2 SP3

On the 2016 box I installed SQL Server Native client 10.0

Get that here : https://www.microsoft.com/en-us/download/details.aspx?id=57606

Finally on the sql server box I had to install patch KB4057113 to enable TLS1.2

Note when testing the connection by opening the .UDL file don’t forget to change the provider to SQL Server Native Client 10.0

answered Jun 21, 2019 at 18:58

drzounds's user avatar

drzoundsdrzounds

3693 silver badges16 bronze badges

Similiar to Jonas Appelgran’s answer, but some slight changes to solve our issue.

  1. Download and install install Microsoft OLE DB Driver for SQL Server (MSOLEDBSQL)
  2. Replace Provider=SQLOLEDB; with Provider=MSOLEDBSQL19; in all connection strings for the ASP Classic scripts (note the version of the driver was needed)
  3. At this point, was still getting the following error:

SSL Provider: The certificate chain was issued by an authority that is
not trusted.

After some research, I found that I also needed to either trust the server certificate or set the encryption to false in the connection string:

Trust Server Certificate=True;
and/or
Use Encryption for Data=False;

Need to update these depending on your situation but it was an internal intranet application only for us so either option was fine. (Otherwise you would need to create and install either a self-signed certificate or one from your organization’s CA.)

answered Jul 11, 2022 at 22:27

Tahari's user avatar

TahariTahari

1316 bronze badges

  1. Open Regedit (Wind+R > regedit)
  2. Locate HKLMSOFTWAREMicrosoftMSSQLServerMSSQLServerSuperSocketNetLib
  3. Create a new word value and name it «Certificate» set the value to this: «Certificate=0»
  4. Also modify the default REG_SZ and set the value to «Certificate=0»
  5. Restart the MSSQL service

Hope this helps since worked for me.

answered Dec 15, 2017 at 15:03

Waldy Al-Monte's user avatar

I have come here today after speding days trying to solve an issue. I have this ASP.Net application that I have been working on since 2010.

Recently a new client showed interest in using the application. Of course, there were several requirements that my application needed to have. This client is very cautious when talking about security.

One of the most important requirements was the support for the protocol TLS 1.2 They would disable older protocols (SSL 3.0, TLS 1.0), and only enable TLS 1.2

As soon as they did that in their server my application stopped working. It was working before just fine, and the reason they need to apply this configuration is because they want to let users connect to the app through the Internet, not only inside their lan.

This is the error I am getting when trying to connect to the application

[OleDbException (0x80004005): [DBNETLIB][ConnectionOpen (SECCreateCredentials()).]SSL Security error.]
   System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +497
   System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +100
   System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions) +57
   System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +1143
   System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +314
   System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +23
   System.Data.OleDb.OleDbConnection.Open() +52
   XS.dbUtils.TConexao.conexao@0(String sessionid) +1103
   XS.dbUtils.TConexao.conexao(String sessionid, Boolean novaconexao) +70
   XS.dbUtils.TUtils.QryOpen2(String sessionid, String sql, Object[] Parametros) +65
   XS.dbUtils.TUtils.QryValues(String sessionid, String sql, Object[] Parametros, String[] DefaultValue) +41
   GestaoEstrategica.TLoginNovo.Page_Load(Object sender, EventArgs ev) +411
   System.Web.UI.Control.OnLoad(EventArgs e) +103
   System.Web.UI.Control.LoadRecursive() +68
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1381

Here is the enviroment:

  • Asp.Net Application running with .Net 4.5.2
  • SQL Server 2012
  • Today I tried to connect to an instance using SQL Server 2016

Here are the things I have found and tried in order to solve this problem:

  • First I thought my application would not work with TLS 1.2, so I did what it is saying here blogs.perficient.com/microsoft/2016/04/tsl-1-2-and-net-support/

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
  • Second I started to think it was related to the SQL Version. I found this page here talking about an update:  blogs.msdn.microsoft.com/sqlreleaseservices/tls-1-2-support-for-sql-server-2008-2008-r2-2012-and-2014/

  • The page above led me to this link support.microsoft.com/pt-br/help/3135244/tls-1-2-support-for-microsoft-sql-server I figured I needed that upate in order to solve the issue. However, none of that worked.

  • Last thing I did was to start an instance of Windows Server 2016 with SQl Server Standard 2016. According to the link above, the SQL Server 2016 already comes with support to TLS 1.2. However, I am getting the same error DBNETLIB][ConnectionOpen
    (SECCreateCredentials()).]SSL Security error

It has been almost a month doing research, reading foruns, and I can’t solve this problem. Can someone help me out? I don’t know what else to try. This is the first time I have to deal with this kind of security, so it has been really hard to understand what
is going on.

Понравилась статья? Поделить с друзьями:
  • Ошибка безопасности parentcontainserrorrecordexception fullyqualifiederrorid unauthorizedaccess
  • Ошибка безопасности kerberos при добавлении серверов
  • Ошибка безопасности kerberos на контроллере ad
  • Ошибка безопасности kerberos server 2012 r2
  • Ошибка безопасного соединения что делать