Feb 10, 2010 at 6:07 PM
Edited Feb 10, 2010 at 6:23 PM
|
Hi, i work in BI area and i'm using de FTPS Library in a Script Task.
I trying connect to FTPS server with Implicit SSL - Port 2121. And i was getting the error: "No Connection could be made because the target machine actively refused it". So, looking the source, i see that is not default port on ESSLSupportMode.Implict.
I change the code to port 2121, just for see if it works.
Here is the code changed: int port = (sslSupportMode & ESSLSupportMode.Implicit) == ESSLSupportMode.Implicit ? 2121 : 21;
Now, the error is: "The handshake failed due to an unexpected packet format". So i try the approach that
robjohnson. Putting a additional If in the method GetDataStream().
Here is the entire description of the error:
em System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
em System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
em System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
em System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
em System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
em System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
em System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
em AlexPilotti.FTPS.Client.FTPSClient.CreateSSlStream(Stream s, Boolean leaveInnerStreamOpen)
em AlexPilotti.FTPS.Client.FTPSClient.SwitchCtrlToSSLMode()
em AlexPilotti.FTPS.Client.FTPSClient.Connect(String hostname, Int32 port, NetworkCredential credential, ESSLSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, X509Certificate
x509ClientCert, Int32 sslMinKeyExchangeAlgStrength, Int32 sslMinCipherAlgStrength, Int32 sslMinHashAlgStrength, Nullable`1 timeout, Boolean useCtrlEndPointAddressForData)
em AlexPilotti.FTPS.Client.FTPSClient.Connect(String hostname, Int32 port, NetworkCredential credential, ESSLSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate, X509Certificate
x509ClientCert, Int32 sslMinKeyExchangeAlgStrength, Int32 sslMinCipherAlgStrength, Int32 sslMinHashAlgStrength, Nullable`1 timeout)
em AlexPilotti.FTPS.Client.FTPSClient.Connect(String hostname, NetworkCredential credential, ESSLSupportMode sslSupportMode, RemoteCertificateValidationCallback userValidateServerCertificate)
em AlexPilotti.FTPS.Client.FTPSClient.Connect(String hostname, NetworkCredential credential, ESSLSupportMode sslSupportMode)
em ScriptTask_a274746f83144e22af02375b4125685d.ScriptMain.Main()
I just can't figure it out, why or where is the error. Im not a pro in C# and .NET plataform, so it's complicate.
Any help would be much appreciated. Thanks, Rodrigo Carvalho.
P.S.: Sorry some english language mistakes. I'm a brazillian and my english it's terrible.
|