c# 请求https网站失败

自己写了个小程序,在Win11下访问正常,windows 2022 上 访问https网站,

错误信息如下

System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.Security.Authentication.AuthenticationException: Authentication failed because the remote party sent a TLS alert: 'HandshakeFailure'.
---> System.ComponentModel.Win32Exception (0x80090326): 接收到的消息异常,或格式不正确。

但是用浏览器,apipost和postman访问正常,因为是这些程序本身有一套加密,而c#程序依赖系统

 

sslscan工具

https://github.com/rbsec/sslscan/releases/tag/2.2.1

下载后cmd里运行 sslscan --tlsall www.syd.com.cn:443

结果如下

image

 Version: 2.2.1 Windows 64-bit (Mingw)

OpenSSL 3.5.0 8 Apr 2025

Connected to 124.95.179.4

Testing SSL server www.syd.com.cn on port 443 using SNI name www.syd.com.cn

SSL/TLS Protocols:
TLSv1.0 disabled
TLSv1.1 disabled
TLSv1.2 enabled
TLSv1.3 enabled

TLS Fallback SCSV:
Server supports TLS Fallback SCSV

TLS renegotiation:
Session renegotiation not supported

TLS Compression:
Compression disabled

Heartbleed:
TLSv1.3 not vulnerable to heartbleed
TLSv1.2 not vulnerable to heartbleed

Supported Server Cipher(s):
Preferred TLSv1.3 128 bits TLS_AES_128_GCM_SHA256 Curve 25519 DHE 253
Accepted TLSv1.3 256 bits TLS_AES_256_GCM_SHA384 Curve 25519 DHE 253
Accepted TLSv1.3 256 bits TLS_CHACHA20_POLY1305_SHA256 Curve 25519 DHE 253
Preferred TLSv1.2 256 bits ECDHE-RSA-AES256-GCM-SHA384 Curve 25519 DHE 253
Accepted TLSv1.2 256 bits ECDHE-RSA-CHACHA20-POLY1305 Curve 25519 DHE 253
Accepted TLSv1.2 128 bits ECDHE-RSA-AES128-GCM-SHA256 Curve 25519 DHE 253

Server Key Exchange Group(s):
TLSv1.3 128 bits secp256r1 (NIST P-256)
TLSv1.3 192 bits secp384r1 (NIST P-384)
TLSv1.3 260 bits secp521r1 (NIST P-521)
TLSv1.3 128 bits x25519
TLSv1.3 224 bits x448
TLSv1.2 128 bits secp256r1 (NIST P-256)
TLSv1.2 192 bits secp384r1 (NIST P-384)
TLSv1.2 260 bits secp521r1 (NIST P-521)
TLSv1.2 128 bits x25519
TLSv1.2 224 bits x448

SSL Certificate:
Signature Algorithm: sha256WithRSAEncryption
RSA Key Strength: 2048

Subject: *.syd.com.cn
Altnames: DNS:*.syd.com.cn, DNS:www.syd.cn, DNS:syd.com.cn
Issuer: CFCA OV OCA

Not valid before: Jan 5 05:53:11 2026 GMT
Not valid after: Jan 23 05:53:10 2027 GMT

 

posted @ 2026-03-12 16:24  simadi  阅读(1)  评论(0)    收藏  举报