TLS在服务器框中失败,但在本地工作正常

时间:2015-07-01 16:32:17

标签: c# https openssl ssl-certificate system.net.httpwebrequest

我有一个网站通过https调用网络API,一切都在C#.net中,并且它工作得很好,直到API的提供商更改了证书以删除SSL并且我开始得到:

Authentication failed because the remote party has closed the transport stream.

在我添加的修复程序之后:

ServicePointManager.SecurityProtocol = 
        SecurityProtocolType.Tls | 
        SecurityProtocolType.Tls11 | 
        SecurityProtocolType.Tls12;

为了只允许使用tls密码,一切都在本地使用我在实时环境中调用的相同URL工作正常,但在实时服务器上我仍然得到:

Authentication failed because the remote party has closed the transport stream.

我确保代码更新,应用程序池被回收,Tls协议在注册密钥上启用。

有人有什么建议吗?这个API是公共第三方的

OPENSSL调用以检索证书:

$ openssl s_client -showcerts -connect ws.purple-parking.com:443
CONNECTED(00000003)
depth=0 /1.3.6.1.4.1.311.60.2.1.3=GB/2.5.4.15=Private Organization/serialNumber=
02341479/C=GB/ST=MIDDLESEX/L=Southall/O=Purple Parking Limited/CN=www.purpleparking.com
verify error:num=20:unable to get local issuer certificate
verify return:1
depth=0 /1.3.6.1.4.1.311.60.2.1.3=GB/2.5.4.15=Private Organization/serialNumber=
02341479/C=GB/ST=MIDDLESEX/L=Southall/O=Purple Parking Limited/CN=www.purpleparking.com
verify error:num=27:certificate not trusted
verify return:1
depth=0 /1.3.6.1.4.1.311.60.2.1.3=GB/2.5.4.15=Private Organization/serialNumber=02341479/C=GB/ST=MIDDLESEX/L=Southall/O=Purple Parking Limited/CN=www.purpleparking.com
verify error:num=21:unable to verify the first certificate
verify return:1
---
Certificate chain
0 s:/1.3.6.1.4.1.311.60.2.1.3=GB/2.5.4.15=Private Organization/serialNumber=023
41479/C=GB/ST=MIDDLESEX/L=Southall/O=Purple Parking Limited/CN=www.purpleparking.com
   i:/C=US/O=thawte, Inc./CN=thawte EV SSL CA - G3
-----BEGIN CERTIFICATE-----
MIIGnTCCBYWgAwIBAgIQFINUUfQAQ/jRmnwUyl5IODANBgkqhkiG9w0BAQs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Eks0P7GlI7rD8JEnDyaP24Zw/oK8Q2t79HYz3VvQ3Uiz+YeNvE1yf/JDSlQ8uq
MbPO1SuLlS0jBI7XEpreNAA=
-----END CERTIFICATE-----
1 s:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=Terms of use at https://www.verisign.com/rpa (c)06/CN=VeriSign Class 3 Extended Validation SSL SGC CA
   i:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc.
- For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5
-----BEGIN CERTIFICATE-----
MIIGHjCCBQagAwIBAgIQLEjdkw31WY75PJlUemDtQzANBgkqhkiG9w0BAQUFADCB
yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL
ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp
U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW
ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0
aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMTYxMTA3MjM1OTU5WjCBvjEL
MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW
ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTswOQYDVQQLEzJUZXJtcyBvZiB1c2UgYXQg
aHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JwYSAoYykwNjE4MDYGA1UEAxMvVmVy
aVNpZ24gQ2xhc3MgMyBFeHRlbmRlZCBWYWxpZGF0aW9uIFNTTCBTR0MgQ0EwggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9Voi6iDRkZM/NyrDu5xlzxXLZ
u0W8taj/g74cA9vtibcuEBolvFXKQa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0IYON7k
7knIE8kL7ATDQHEYcnZDAiNdq3vISBQayHsd/PYKnzah0glzcWaWdVE0v5kwUWed
VLcmRaxzCCOGJplx9I7X6jmbBgkjv2LdqMS2faSJBz7zba5AWVB5lzc9Mnh9smNL
+eoIaQ4T7ejPu6wFhsoiz4hiXTwiSdhj1SSmve9c48wgOyLq/ETGqOUf4YbNDE2P
k1PZf+6hCKezMJZJcG6jbD3QY+8lZmPMqrcYF07qcHb2ukKmgDcJTp9miC5rM2bI
wHGkQeta4/wULkuI/a5uW2XpJ+S/5LAjwbJ9W2Il1z4Q1A==
-----END CERTIFICATE-----
2 s:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc.
- For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5
   i:/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
-----BEGIN CERTIFICATE-----
MIIE0DCCBDmgAwIBAgIQJQzo4DBhLp8rifcFTXz4/TANBgkqhkiG9w0BAQUFADBf
MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xNzA1BgNVBAsT
LkNsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw
HhcNMDYxMTA4MDAwMDAwWhcNMjExMTA3MjM1OTU5WjCByjELMAkGA1UEBhMCVVMx
FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz
dCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZv
ciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAz
IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw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1Cvxm1XjRl4t7mi0VfqH5pLr7rJjhJ+xr3/
-----END CERTIFICATE-----
---
Server certificate
subject=/1.3.6.1.4.1.311.60.2.1.3=GB/2.5.4.15=Private Organization/serialNumber=
02341479/C=GB/ST=MIDDLESEX/L=Southall/O=Purple Parking Limited/CN=www.purpleparking.com
issuer=/C=US/O=thawte, Inc./CN=thawte EV SSL CA - G3
---
No client certificate CA names sent
---
SSL handshake has read 5457 bytes and written 444 bytes
---
New, TLSv1/SSLv3, Cipher is DHE-RSA-AES256-SHA
Server public key is 2048 bit
Compression: NONE
Expansion: NONE
SSL-Session:
    Protocol  : TLSv1
    Cipher    : DHE-RSA-AES256-SHA
    Session-ID: F286D708BDD3413C688722CCC5C89DA65217668DF16739C6495A8EF4216B3C76

    Session-ID-ctx:
    Master-Key: 806065D476B184621B040B4E6E9E384BEDECF90551946E6B68AB6ABA530C5C208735676C249F06E56D081062017660E4
    Key-Arg   : None
    Start Time: 1435830533
    Timeout   : 300 (sec)
    Verify return code: 21 (unable to verify the first certificate)
---
read:errno=0

1 个答案:

答案 0 :(得分:0)

问题是服务器,没有R2服务包的Windows 2008不支持高于v1.0的TLS