【Azure App Service】访问App Service应用报错 SSL: WRONG_VERSION_NUMBER

问题描述

应用部署在Azure App Service中,访问Default URL,遇见SSL: WRONG_VERSION_NUMBER错误。

REST API工具调用时错误信息:

write EPROTO 8936192:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:..\..\third_party\boringssl\src\ssl\tls_record.cc:231:

Python 代码中调用时的错误信息:

import requests

reqUrl = "https://xxx-xxx-x.chinacloudsites.cn/"

headersList = {
 "Accept": "*/*", 
}
payload = ""
response = requests.request("GET", reqUrl, data=payload,  headers=headersList)
print(response.text)

错误信息

urllib3.exceptions.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1000)

 

 

问题解答

当看见错误信息为 SSL wrong version,第一猜测是TLS Version是否变动了呢?

因最近Azure App Service支持TLS 1.3,是不是因为客户端发起的请求还是TLS 1.2,不满足它的要求,所以返回错误WRONG_VERSION_NUMBER.

但是,当把Minimum Inbound TLS version修改为1.2后,问题依旧!

 

最后,在去掉TLS,通过http的方式访问时,发现了问题的根本原因 : 上海蓝云阻断页

 

温馨提示:该网站暂时无法进行访问

原因一:您尚未根据工信部相关法规申请经营许可或进行网站备案;
原因二:您未根据公安部相关法规完成公安备案;
原因三:网站内容与备案信息不符,建议网站管理员尽快修改网站信息;
原因四:您的网站可能存在不适宜传播的信息,请联系您的网站管理员;
原因五:您的网站应用没有绑定自定义域名,请绑定已备案的自定义域名。(了解更多详情

本页面为默认提示页面,如网站存在以上问题请及时进行相关处理。
上海蓝云用户ICP备案请登录上海蓝云备案管理系统
上海蓝云用户公安备案请登陆全国公安机关互联网安全管理服务平台
谢谢合作!
Sorry, the website is unable to be accessed at this moment.
According to the ICP filling requirements of China's Ministry of Industry and Information
Technology (MIIT) and China Public Security Ministry.
a website is accessible only if the registration is completed and the filled information is accurate.
In addition, the access should be suspended if any prohibited content is published or disseminated.
If the website has not bound a custom domain, please bind your own custom domain with ICP filing for your website.(Learn More..

 

所以,这种情况的解决办法有两种

1: 根据信息提示,对App Service进行自定义域名,并进行ICP备案。https://www.azure.cn/support/icp/icp-faq/

2:让App Service内部访问(只在Azure的数据中心访问),如果需要公网访问,可以在它的前端部署一个Application Gateway用于接受公网请求:https://docs.azure.cn/zh-cn/app-service/overview-app-gateway-integration

 

posted @ 2024-07-09 20:02  路边两盏灯  阅读(2)  评论(0编辑  收藏  举报