自v12升级以来,Azure SQL数据库错误TLS握手失败 [英] Azure SQL Database error TLS Handshake failed since v12 upgrade

查看:258
本文介绍了自v12升级以来,Azure SQL数据库错误TLS握手失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天早上收到这个错误,新的v12更新服务器/ Azure SQL数据库:
$ b


TLS握手失败:x509:证书是适用于
tr12.northcentralus1-a.worker.database.windows.net,
* .tr12.northcentralus1-a.worker.database.windows.net,而不是[server-name] .database.windows .net


本地连接到Azure SQL数据库没有问题。在Azure Web App上,无法建立连接。



与本地连接字符串相同 - 在v12更新前正常工作。



我使用这个SQL驱动程序 github.com/denisenkom/go-mssqldb /



任何指针,不相信我应该改变连接字符串?编辑1:只是试图替换 [server-name] .database.windows。为什么它在本地而不是Azure web应用上工作。 net 与tr12 ...但tcp连接无法建立。



编辑2:这是连接字符串,如果它可以帮助,底线,为什么它在本地工作,相同的驱动程序包版本,我在本地构建可执行文件并通过FTP进行部署,因此不对此应用程序使用Kudo部署。正在工作A1,直到Azure自动升级到v12。


Server = [server-name] .database.windows.net; Port = 1433 ; Database = [dbname]; User
ID = [user]; Password = [pass]; Trusted_Connection = False; Encrypt = True; Connection
Timeout = 30;

信任连接应该是真的吗?或加密错误?编辑3:我已经看过来自Azure门户的连接字符串,并且v12似乎有这个新的参数:

code> TrustServerCertificate = False 但没有机会,没有解决问题

解决方案

在这个封闭的问题上,我将 TrustServerCertificate False 更改为 True 并将此参数 hostNameInCertificate 添加到连接字符串中,并且它现在正在工作:

https://github.com/denisenkom/go-mssqldb/issues/55



TrustServerCertificate = True; hostNameInCertificate = *。database.windows.net;



Azure门户建议具有 TrustServerCertificate = False 并且没有 hostNameInCertificate


I receive this error since this morning, new v12 updated server / Azure SQL Database:

TLS Handshake failed: x509: certificate is valid for tr12.northcentralus1-a.worker.database.windows.net, *.tr12.northcentralus1-a.worker.database.windows.net, not [server-name].database.windows.net

Locally I have no problem connecting to the Azure SQL database. On Azure Web App the connection cannot be established.

Same connection string as local - was working fine before v12 update.

I'm using this SQL driver github.com/denisenkom/go-mssqldb/

Any pointer, don't believe I should change the connection string? Why it's working on local and not on Azure web app.

Edit 1: Just tried to replace [server-name].database.windows.net with the tr12... but tcp connection cannot be established.

Edit 2: Here's the connection string if it can help, bottom line, why it's working locally, same driver package version, I'm building executable locally and deploying via FTP, so not using Kudo deployment for this app. Was working A1 until Azure auto-upgraded to v12.

Server=[server-name].database.windows.net;Port=1433;Database=[dbname];User ID=[user];Password=[pass];Trusted_Connection=False;Encrypt=True;Connection Timeout=30;

Should trusted connection be true? or Encryption false? Will try changing those to see....

Edit 3: I've look at the connection string from Azure portal, and v12 seems to have this new parameters: TrustServerCertificate=False but no chance, did not fixed the issue

解决方案

Based on this closed issue I changed TrustServerCertificate from False to True and added this parameter hostNameInCertificate to the connection string and it is working now:

https://github.com/denisenkom/go-mssqldb/issues/55

TrustServerCertificate=True;hostNameInCertificate=*.database.windows.net;

Azure portal suggests to have TrustServerCertificate=False and no hostNameInCertificate.

这篇关于自v12升级以来,Azure SQL数据库错误TLS握手失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆