Error if I try to connect to an S3

Advertisement

fakharos
Joined:
Posts:
5

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
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"
}

Reply with quote

Advertisement

fakharos
Joined:
Posts:
5

Session logs

$WinSCPSessionOption = New-WinSCPSessionOption -Hostname $S3_Serveur -Protocol S3 -PortNumber $S3_Port -Credential $credential -GiveUpSecurityAndAcceptAnyTlsHostCertificate -Verbose
. 2023-10-31 11:13:13.683 x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
. 2023-10-31 11:13:13.683 Sending request-line and headers:
. 2023-10-31 11:13:13.683 Doing DNS lookup on XXXXXXXXX...
. 2023-10-31 11:13:13.721 req: Connecting to XXXXXXXXX
. 2023-10-31 11:13:13.736 Doing SSL negotiation.
. 2023-10-31 11:13:13.756 ssl: Verify callback @ 0 => 18
. 2023-10-31 11:13:13.756 ssl: Verify failures |= 8 => 8
. 2023-10-31 11:13:13.769 Chain depth: 1
. 2023-10-31 11:13:13.769 ssl: Match common name 'XXXXXXXXX' against ''
. 2023-10-31 11:13:13.769 Identity match for '': bad
. 2023-10-31 11:13:13.769 ssl: Match common name 'XXXXXXXXX' against 'XXXXXXXXX'
. 2023-10-31 11:13:13.770 Identity match for 'XXXXXXXXX': good
. 2023-10-31 11:13:13.770 Verifying certificate for "XXXXXXXXX" with fingerprint XXXXXXXXX and 08 failures
< 2023-10-31 11:13:13.770 Script: WARNING! Giving up security and accepting any certificate as configured!
* 2023-10-31 11:13:13.770 WARNING! Giving up security and accepting any certificate as configured!
. 2023-10-31 11:13:13.771 Using TLSv1.2, cipher TLSv1.2: AES256-GCM-SHA384, 2048 bit RSA
. 2023-10-31 11:13:13.771 Request sent; retry is 0.
. 2023-10-31 11:13:13.780 ssl: Got OpenSSL error stack 0
. 2023-10-31 11:13:13.780 Aborted request (-5): Could not read status line
. 2023-10-31 11:13:13.780 sess: Closing connection.
. 2023-10-31 11:13:13.780 ssl: Shutdown state: not sent | not received.
. 2023-10-31 11:13:13.780 ssl: Sending closure.
. 2023-10-31 11:13:13.781 sess: Connection closed.
. 2023-10-31 11:13:13.781 Request ends, status 0 class 0xx, error line:
. 2023-10-31 11:13:13.781 Could not read status line: Secure connection truncated
. 2023-10-31 11:13:13.781 Could not read status line: Secure connection truncated
. 2023-10-31 11:13:13.781 Running destroy hooks.
. 2023-10-31 11:13:13.781 Request ends.
. 2023-10-31 11:13:13.781 sess: Destroying session.
< 2023-10-31 11:13:13.781 Script: Could not read status line: Secure connection truncated
< 2023-10-31 11:13:13.781 Connection failed.

Reply with quote

martin
Site Admin
martin avatar

Re: Session logs

Unfortunately, you have obfuscated the log to the point of uselessness.
What S3 server is that? Can you connect to the server using any other S3 client from the same local machine?

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum