Error if I try to connect to an S3
I get an error if I try to connect to an S3:
Is it possible to help me? Thanks
My code:
Is it possible to help me? Thanks
New-WinSCPSession : Exception lors de l'appel de « Open » avec « 1 » argument(s) : « Could not read status line: Secure connection truncated Connection failed. » Au caractère Ligne:22 : 18 + ... CPSession = New-WinSCPSession -SessionOption ($WinSCPSessionOption) - ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [New-WinSCPSession], MethodInvocationException + FullyQualifiedErrorId : SessionRemoteException,New-WinSCPSession
My code:
$credential = New-Object System.Management.Automation.PSCredential($S3_User, $S3_Password_Convert) $WinSCPSessionOption = New-WinSCPSessionOption -Hostname $S3_Serveur -Protocol S3 -PortNumber $S3_Port -Credential $credential -TlsHostCertificateFingerprint "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -Verbose $WinSCPSessionOption.RootPath = "/" $WinSCPSessionOption.Secure = $true $WinSCPSession = New-WinSCPSession -SessionOption ($WinSCPSessionOption) -SessionLogPath "C:\Session.log" -DebugLogPath "C:\Debug.log" -Verbose -DebugLogLevel 2 $Session = Get-WinSCPSession -WinSCPSession $WinSCPSession if ($Session.Opened -eq $true) { Write-Host "Acces S3 sur le serveur : OK" } else { Write-Host "Acces S3 sur le serveur : KO" }