The instance of SQL Server you attempted to connect to requires encryption but this machine does not support it. RRS feed

  • Question

  • Iam trying to connect Azure SQL from Console app or Asp.net web application   in Windows Server 2008 r2  with .Net framework 4.5.1 using Entity framework 5.0 installed and getting the below error . The connecting string and every thing looks fine and same  application connecting from local windows 10 environment machine

    Unhandled Exception: System.Data.EntityException: The underlying provider failed  to Open. ---> System.Data.SqlClient.SqlException: The instance of SQL Server you  attempted to connect to requires encryption but this machine does not support it.

    Has any one faced this issue

    Monday, March 11, 2019 3:58 PM

All replies

  • Azure SQL mandates encrpytion on all connection all the time.

    Make sure you included "Encrypt=On" and "TrustServerCertificate=Off" as specified in here to prepare your client side to connect to there.

    If still fails after checking connection string, check the second half of this KB article (the first helf is about database server configuration and is irrelevent to you as you're using Azure SQL) and see if any settings there can help.

    Tuesday, March 12, 2019 1:18 AM
  • Hi Wendy,

     I have tried both connection string one in config file with Encrypt=true and TrustServerCertificate=false

    and second half the kb article  also  which tells about the registry TLS1.2 enabling but still getting the same error

    • Edited by Sandeep GV Tuesday, March 12, 2019 8:36 AM
    Tuesday, March 12, 2019 8:35 AM
  • From what I've found this is related to Error Code 20 being returned from the underlying driver. However I'm unable to find related troubleshooting guide for exactly this error.

    There's a StackOverflow article on related topic containing registry tweak that you may want to try. (Be sure to export the affecting registry keys first)

    The registry changes in SO article are for 32-bit SQL client. If your application runs 64-bit you may run on normal "Software" Note instead of which inside "Wow6432Node".

    If that does not work, maybe you can try upgrading to ADO.NET 4.6.2 or later (Actually it's telling you to upgrade to .NET Framework v4.6.2+) as recommended in the first article and see if it can fix your connection issue.

    I've leaved a word at the "suggestion" of their connectivity troubleshooter because this error is not found there, however since you currently have subscription, I suggest you to contact their help directly (Scroll to the end at the left menu to find "Help + Support" item) and see if you can offer other advice.

    Tuesday, March 12, 2019 3:17 PM
  • Also check comments from this thread.

    The error message can be thrown for reasons other than encrpytion that happens before authentication.

    You'd want to contact Azure Support for help on troubleshooting this if it still happens.

    Thursday, March 14, 2019 8:08 AM