为此,我已经在Windows 7 Professional SP1 pc上使用Visual Studio 2015 express安装了.net framework 4.6并编译了SW. VS中“应用程序”下的目标框架已设置为4.6
在SW我使用SslStream方法验证证书,并确保只使用TLS 1.2,我输入行
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
我尝试在main()和插入新的SSL流之前插入这一行
对于测试我使用openssl连接,使用命令:
openssl s_client -connect 10.0.0.101:1400 -tls1_2 -cert MyCert.pem@H_301_14@ -key private.pem -CAfile entrust.cer
我的问题是C#程序得到以下异常:
Exception: A call to SSPI Failed,see inner exception.
Inner exception: The function requested is not supported
OpenSsl的输出是
CONNECTED(00000150) 7964:error:1408F10B:SSL@H_301_14@ routines:SSL3_GET_RECORD:wrong version number:.\ssl\s3_pkt.c:362:
no peer certificate available
No client certificate CA names sent
SSLL handshake has read 5 bytes and written 7 bytes
New,(NONE),Cipher is (NONE) Secure Renegotiation IS NOT supported@H_301_14@ Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session:@H_301_14@ Protocol : TLSv1.2@H_301_14@ Cipher : 0000@H_301_14@ Session-ID:@H_301_14@ Session-ID-ctx:@H_301_14@ Master-Key:@H_301_14@ Key-Arg : None@H_301_14@ PSK identity: None@H_301_14@ PSK identity hint: None@H_301_14@ SRP username: None@H_301_14@ Start Time: 1457011106@H_301_14@ Timeout : 7200 (sec)@H_301_14@ Verify return code: 0 (ok)
如果我使用-tls1没有问题,所以我认为这是因为.net SslStream不支持tls1_2(或tls1_1)
有没有人可以解释我做错了什么
/卡斯滕