Condividi tramite


L'errore SSL_PE_NO_CIPHER si verifica nell'endpoint 5022 in SQL Server

Questo articolo consente di risolvere l'errore correlato a che si verifica nell'endpoint SSL_PE_NO_CIPHER 5022. Fornisce anche script per l'applicazione di Transport Layer Security (TLS) in diverse versioni di .NET Framework.

Sintomi

L'errore "SSL_PE_NO_CIPHER" ssl (Security Socket Layer) si verifica sulla porta dell'endpoint 5022 e si verifica un ritardo di tempo superiore a 15 secondi, causando potenzialmente timeout. Si verifica quando l'handshake SSL ha esito negativo a causa della mancanza di pacchetti di crittografia compatibili tra il client e il server. Ciò può verificarsi se vengono usati algoritmi di crittografia obsoleti o deboli.

Risoluzione

Per risolvere questo errore, attenersi alla seguente procedura:

  1. Aggiornare le librerie SSL o TLS. Assicurarsi che sia il client che il server dispongano di librerie SSL o TLS aggiornate installate. Le versioni obsolete potrebbero non supportare suite di crittografia moderne e sicure.

  2. Controllare le configurazioni di Cipher Suite sia nel client che nel server. Assicurarsi che i pacchetti di crittografia moderni e sicuri siano consentiti. È consigliabile disabilitare i pacchetti di crittografia obsoleti o deboli.

  3. Verificare le versioni del protocollo SSL o TLS. Verificare che sia il client che il server supportano le stesse versioni del protocollo SSL o TLS. Le versioni del protocollo obsolete potrebbero non essere compatibili con alcuni pacchetti di crittografia. Se TLS 1.2 non è presente nei server, eseguire lo script seguente per applicare TLS 1.2 in .NET Framework:

    # .NET Framework v2.0.50727 
    New-Item -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework\v2.0.50727" -Force | Out-Null 
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework\v2.0.50727" -Name "AspNetEnforceViewStateMac" -Value 1 
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework\v2.0.50727" -Name "SystemDefaultTlsVersions" -Value 1 
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework\v2.0.50727" -Name "SchUseStrongCrypto" -Value 1
    
    # .NET Framework v4.0.30319 
    New-Item -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" -Force | Out-Null 
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" -Name "AspNetEnforceViewStateMac" -Value 1 
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" -Name "SystemDefaultTlsVersions" -Value 1 
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" -Name "SchUseStrongCrypto" -Value 1
    
    # Wow6432Node\Microsoft\.NETFramework\v2.0.50727 
    New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727" -Force | Out-Null
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727" -Name "AspNetEnforceViewStateMac" -Value 1
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727" -Name "SystemDefaultTlsVersions" -Value 1
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727" -Name "SchUseStrongCrypto" -Value 1
    
    # Wow6432Node\Microsoft\.NETFramework\v4.0.30319 
    New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319" -Force | Out-Null
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319" -Name "AspNetEnforceViewStateMac" -Value 1
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319" -Name "SystemDefaultTlsVersions" -Value 1
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319" -Name "SchUseStrongCrypto" -Value 1
    
    # WinHTTP
    New-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp" -Force | Out-Null
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp" -Name "DefaultSecureProtocols" -Value 0x00000800
    
    # Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp 
    New-Item -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet  Settings\WinHttp" -Force | Out-Null
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Internet Settings\WinHttp" -Name "DefaultSecureProtocols" -Value 0x00000800
    
  4. Abilitare TLS eseguendo lo script seguente:

    # Enable TLS 1.2
    New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" -Force | Out-Null
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" -Name "DisabledByDefault" -Value 0
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" -Name "Enabled" -Value 1
    New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" -Force | Out-Null
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" -Name "DisabledByDefault" -Value 0
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" -Name "Enabled" -Value 1
    
  5. Disabilitare TLS eseguendo lo script seguente:

    # Disable TLS 1.1 
    New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client" -Force | Out-Null
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client" -Name "DisabledByDefault" -Value 1
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client" -Name "Enabled" -Value 0
    New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server" -Force | Out-Null
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server" -Name "DisabledByDefault" -Value 1
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server" -Name "Enabled" -Value 0
    # Disable TLS 1.0 
    New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client" -Force | Out-Null 
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client" -Name "DisabledByDefault" -Value 1 
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Client" -Name "Enabled" -Value 0 
    New-Item -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server" -Force | Out-Null 
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server" -Name "DisabledByDefault" -Va. ue 1 
    Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.0\Server" -Name "Enabled" -Value 0
    
  6. Controllare l'ora e la data del sistema. L'ora e la data del sistema accurate sono essenziali per la convalida del certificato SSL. Verificare che l'ora e la data di sistema siano corrette sia nel client che nel server.

  7. Verificare i certificati. Assicurarsi che il certificato SSL installato nel server sia valido e non sia scaduto. Verificare se il client è in grado di convalidare correttamente il certificato del server.

  8. Controllare le impostazioni del firewall e del proxy. Verificare che le porte necessarie siano aperte e che nessuna impostazione del firewall o del proxy blocchi l'handshake SSL.

  9. Eseguire lo script come amministratore nei computer client e server.

  10. Riavviare i server dopo aver eseguito lo script.

    Dopo aver completato questi passaggi, è necessario risolvere l'errore "SSL_PE_NO_CIPHER".

Nota

Microsoft consiglia di eseguire il backup del Registro di sistema di Windows.

Vedere anche

Una connessione esistente è stata chiusa forzatamente dall'host remoto (errore del sistema operativo 10054)