Cur síos: Cuireadh deireadh leis an iarratas: Theip ar chruthú cainéal slán SSL/TLS. Níorbh fhéidir cainéal slán SSL/TLS a chruthú. Ardáin a thógáil: Windows Server 2012, Windows 7 Service Pack 1 (SP1), agus Windows Server 2008 R2 SP1
[eachtra] láithreán gréasáin a íoslódáil Is uirlis íoslódála lán-suíomh é Cuir isteach an URL le híoslódáil le cliceáil amháin Tá sé simplí agus éasca le húsáid agus tá tascanna il-snáithithe aige.
Socraigh cód roimh HttpWebRequest
ServicePointManager.Expect100Continue = true; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls; ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
Mura n-oibríonn an modh thuas, is fadhb é leibhéal an chórais Nuashonraigh paiste an chórais de réir an chórais atá in úsáid agat faoi láthair.
Nuashonrú chun TLS 1.1 agus TLS 1.2 a chumasú mar na prótacail slándála réamhshocraithe i WinHTTP i Windows, soláthraíonn an nuashonrú seo tacaíocht do Shlándáil Sraithe Iompair (TLS) i Windows Server 2012, Windows 7 Service Pack 1 (SP1), agus Windows Server 2008 R2 SP1 1.1 agus tacaíocht TLS 1.2, féach le do thoil don doiciméadú oifigiúil https://support.microsoft.com/en-us/help/3140245/update-to-enable-tls-1-1-and-tls-1-2-as-default-secure-protocols-in-wi
Cóipeáil an cód clárúcháin seo a leanas agus é a allmhairiú isteach sa chlár. Cruthaigh txt nua, athraigh an iarmhír txt go reg (eochair chláraithe), agus iompórtáil (déan cúltaca roimh iompórtáil)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp] "DefaultSecureProtocols"=dword:00000a00 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp] "DefaultSecureProtocols"=dword:00000a00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings] "SecureProtocols"=dword:00000a80 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings] "SecureProtocols"=dword:00000a80
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp] "DefaultSecureProtocols"=dword:00000800 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp] "DefaultSecureProtocols"=dword:00000800 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server] "DisabledByDefault"=dword:00000000 "Enabled"=dword:00000001
Osclaíonn PowerShell:
[Net.ServicePointManager]::SecurityProtocol [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Ssl3 -bor [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12
Seiceálann an chéad líne cód an leagan TLS a dtacaítear leis.
Ní oibreoidh ceachtar den dá mhodh roimhe seo, mar sin ní féidir leat ach an modh deiridh a úsáid:
Nóta: Maidir le leaganacha sonracha TSL a fhaigheann tacaíocht ó gach leagan de Windows, féach le do thoil don fhaisnéis fhorlíontach san alt seo.
Tá réitigh ann, ach braitheann siad ar leagan an chreata:
.NET 4.6 agus os a chionn. Ní gá duit aon obair bhreise a dhéanamh chun tacú le TLS 1.2, tacaítear leis de réir réamhshocraithe.
.NET 4.5. Tacaítear le TLS 1.2, ach ní hé an prótacal réamhshocraithe é. Ní mór duit a roghnú chun é a úsáid. Socraíonn an cód seo a leanas TLS 1.2 mar réamhshocrú, déan cinnte é a fhorghníomhú roimh nascadh le hacmhainn shlán:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
.NET 4.0. Ní thacaítear le TLS 1.2, ach má tá .NET 4.5 (nó níos airde) suiteáilte ar do chóras, tá an rogha agat fós TLS 1.2 a úsáid fiú mura dtacaíonn do chreat feidhmchlár le TLS 1.2. Is í an t-aon fhadhb atá ann ná nach bhfuil aon iontráil ag SecurityProtocolType in .NET 4.0 do TLS1.2, mar sin ní mór dúinn léiriú uimhriúil an luach enum seo a úsáid:
ServicePointManager.SecurityProtocol =(SecurityProtocolType)3072;
.NET 3.5 nó níos ísle. Ní thacaítear le TLS 1.2(*) agus ní dhéantar aon réiteach. Uasghrádaigh d’iarratas go dtí an leagan is déanaí den chreat.
PS I gcás cás 3, tá hack clárlainne ann freisin a chuirfidh iallach ar 4.5 TLS 1.2 a úsáid de réir réamhshocraithe gan a bheith iallach air go ríomhchláraitheoir. PPS Mar a luann Christian Pop de chuid Microsoft thíos, tá paiste is déanaí ar fáil do .NET 3.5 a chuireann ar chumas tacaíocht TLS1.2.
Féach:
B'fhéidir gurb é fad an eochair deimhnithe a sholáthraíonn an láithreán gréasáin ná 512 giotán, agus de réir caighdeáin reatha an tionscail, ba cheart go mbeadh eochair phoiblí nach lú ná 2048 giotán ann. D’fhreagair nuashonrú slándála Meán Fómhair 2016 Microsoft don tsaincheist seo trína lua má tá fad na heochrach poiblí níos lú ná 2048 beart (m.sh. RSA 512),Is féidir le Windows naisc HTTPS a chealú
2012 R2 and Windows 8
2008 R2 and Windows 7
SecurityProtocolType.Tls1.0=0xC0; SecurityProtocolType.Tls1.1=0x300; SecurityProtocolType.Tls1.2=0xC00;
.net 4.0/4.5 luach réamhshocraithe: SecurityProtocolType.Tls |. SecurityProtocolType.Ssl3 .net 4.6/4.7 luach réamhshocraithe: SecurityProtocolType.Tls |
SCH_USE_STRONG_CRYPTO Úsáidfear an bhratach seo go huathoibríoch i .NET Framework 4.6 https://support.microsoft.com/en-us/help/3154518/support-for-tls-system-default-versions-included-in-the-net-framework I Win7Sp1 agus .Net 3.5.1, tá TLS1.2 tacaíocht
ServicePointManager.SecurityProtocol &= ~SecurityProtocolType.Ssl3; // Dún ssl3 ServicePointManager.SecurityProtocol |= (SecurityProtocolType)0x300 |
Seo conclúid TLS1.2:
Modhnú na clárlainne faoi .net4
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319] "SchUseStrongCrypto"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319] "SchUseStrongCrypto"=dword:00000001
Tá an t-alt seo scríofa agláithreán gréasáin a íoslódáilBailithe agus eagraithe, tagann an t-ábhar ón Idirlíon, cuir in iúl an fhoinse agus tú ag athphriontáil, go raibh maith agat.