【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
當在復雜的環境中面臨問題,格物之道需:濁而靜之徐清,安以動之徐生。 云中,恰是如此!

浙公網安備 33010602011771號