Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
12.7k views
in .NET FTP by (540 points)
I get the following error when trying to upload a file using SFTP:
INFO [LicenseProperties] 25 Jan 2013 14:54:44.750 : Licence expiry date: 12/31/9999
INFO [LicenseProperties] 25 Jan 2013 14:54:44.751 : Production license
DEBUG [SSLFTPClient] 25 Jan 2013 14:54:44.752 : Connecting to ftp.ftpserver.com:990
DEBUG [SSLFTPControlSocket] 25 Jan 2013 14:54:44.758 : waitOnShutdownSSL=True
DEBUG [HostNameResolver] 25 Jan 2013 14:54:44.772 : Resolving ftp.ftpserver.com
DEBUG [HostNameResolver] 25 Jan 2013 14:54:44.777 : Obtained 1 addresses
DEBUG [HostNameResolver] 25 Jan 2013 14:54:44.778 : IP address: 100.195.83.100
DEBUG [HostNameResolver] 25 Jan 2013 14:54:44.778 : ftp.ftpserver.com resolved to 100.195.83.100
DEBUG [ExFTPControlSocket] 25 Jan 2013 14:54:44.779 : Connecting directly to ftp-server ftp.ftpserver.com:990
INFO [SSLFTPSocket] 25 Jan 2013 14:54:44.781 : Connecting to 100.195.83.100:990 with timeout 120000 ms
DEBUG [SSLFTPControlSocket] 25 Jan 2013 14:54:44.840 : Beginning Tls1 handshake.
DEBUG [SocketController] 25 Jan 2013 14:54:45.035 : Processing hello
ERROR [SocketController] 25 Jan 2013 14:54:45.371 : OnReceive - caught exception - closing
ERROR [SocketController] 25 Jan 2013 14:54:45.371 : EnterpriseDT.Mentalis.Security.Ssl.Shared.SslHandshakeException: The certificate could not be verified: UntrustedRoot - A certification chain processed correctly but terminated in a root certificate not trusted by the trust provider.
ERROR [SocketController] 25 Jan 2013 14:54:45.371 :    at GYvvnpfaXCLkGwjyY4.TxPqk3kvwZT41AXX41.LeX4dwiOYH(vLyDIXT8rKwASe1Pnmi , Boolean )
ERROR [SocketController] 25 Jan 2013 14:54:45.371 :    at GYvvnpfaXCLkGwjyY4.TxPqk3kvwZT41AXX41.BIy4TAUS8D(CdieaoTBvjSF8Pwkb9x , Boolean )
ERROR [SocketController] 25 Jan 2013 14:54:45.371 :    at tug4vRevjtgUy5G6h2.NMqZXat7dNDwhlwrZE.ProcessMessage(CdieaoTBvjSF8Pwkb9x )
ERROR [SocketController] 25 Jan 2013 14:54:45.371 :    at GYvvnpfaXCLkGwjyY4.TxPqk3kvwZT41AXX41.vyS4YRyoWd(NdP473heJXe1xfvOcay )
ERROR [SocketController] 25 Jan 2013 14:54:45.371 :    at VDkGUjmV0kfSA355rVt.u3yKcbmvl8TEeHTHLxQ.SlARmlhCk9(Byte[] , Int32 , Int32 )
ERROR [SocketController] 25 Jan 2013 14:54:45.371 :    at RQvgKYhg8LQCZPHlh4P.dPeHj2hJtYJpimvWDmx.LFWiPGOGNS(Byte[] , Int32 , Int32 )
ERROR [SocketController] 25 Jan 2013 14:54:45.371 :    at RQvgKYhg8LQCZPHlh4P.dPeHj2hJtYJpimvWDmx.IT7imQbMg3(Byte[] , Int32 , Int32 )
ERROR [SocketController] 25 Jan 2013 14:54:45.371 :    at YDYCDBWDPaUPKgZT3SG.lK6vxkWed310ncX86nN.akJuSW6oTi(IAsyncResult )
DEBUG [SocketController] 25 Jan 2013 14:54:45.508 : CloseConnection(e=The certificate could not be verified: UntrustedRoot - A certification chain processed correctly but terminated in a root certificate not trusted by the trust provider.)
DEBUG [SocketController] 25 Jan 2013 14:54:45.509 : Shut down socket
DEBUG [SocketController] 25 Jan 2013 14:54:45.513 : Closed socket


The application that I am using the library in has been up and running for quite a while now. The only difference is we just upgraded the production machine to a new Windows 7 Pro 64 bit machine from a WIndows XP Pro 32 bit OS. The server is a server that I do not control and if I run the application on my dev machine it uploads the files perfectly. Below is the log from my dev machine.

INFO [LicenseProperties] 28 Nov 2012 12:25:38.659 : Production license
DEBUG [SSLFTPClient] 28 Nov 2012 12:25:38.660 : Connecting to ftp.ftpserver.com:990
DEBUG [SSLFTPControlSocket] 28 Nov 2012 12:25:38.662 : waitOnShutdownSSL=True
DEBUG [HostNameResolver] 28 Nov 2012 12:25:38.667 : Resolving ftp.ftpserver.com
DEBUG [HostNameResolver] 28 Nov 2012 12:25:38.682 : Obtained 1 addresses
DEBUG [HostNameResolver] 28 Nov 2012 12:25:38.683 : IP address: 100.195.83.100
DEBUG [HostNameResolver] 28 Nov 2012 12:25:38.683 : ftp.ftpserver.com resolved to 100.195.83.100
DEBUG [ExFTPControlSocket] 28 Nov 2012 12:25:38.684 : Connecting directly to ftp-server ftp.ftpserver.com:990
ALL [AsyncResult] 28 Nov 2012 12:25:38.688 : WaitOne begin: 100 0
ALL [AsyncResult] 28 Nov 2012 12:25:38.856 : Notify setting completed: null 0
ALL [AsyncResult] 28 Nov 2012 12:25:38.857 : Notify setting wait: 0
ALL [SecureSocket] 28 Nov 2012 12:25:38.858 : Notify: SecureSocket.OnConnect
ALL [AsyncResult] 28 Nov 2012 12:25:38.858 : WaitOne end: True 0
DEBUG [SSLFTPControlSocket] 28 Nov 2012 12:25:38.860 : Beginning Ssl3 handshake.
DEBUG [SecureSocket] 28 Nov 2012 12:25:38.861 : Changing protocol to Ssl3
DEBUG [SSLFTPControlSocket] 28 Nov 2012 12:25:38.861 : Ssl3 handshake complete.
DEBUG [FTPControlSocket] 28 Nov 2012 12:25:38.862 : Setting socket timeout=120000
ALL [TransferBuffer] 28 Nov 2012 12:25:38.863 : TransferBuffer timeout=120000
ALL [SocketController] 28 Nov 2012 12:25:38.864 : SocketController timeout=120000
ALL [SecureSocket] 28 Nov 2012 12:25:38.865 : SecureSocket timeout=120000
ALL [TransferBuffer] 28 Nov 2012 12:25:38.865 : TransferBuffer timeout=120000
ALL [SocketController] 28 Nov 2012 12:25:38.866 : SocketController timeout=120000
DEBUG [SocketController] 28 Nov 2012 12:25:38.928 : Processing hello
ALL [SecureSocket] 28 Nov 2012 12:25:39.056 : SecureSocket timeout=120000
DEBUG [FTPControlSocket] 28 Nov 2012 12:25:39.058 : Command encoding=System.Text.ASCIIEncoding
DEBUG [ExFTPControlSocket] 28 Nov 2012 12:25:39.060 : Created control-socket: SocksContext=, ProxySettings=NoProxy, RemoteHost=ftp.ftpserver.com, controlPort=990, timeout=120000
DEBUG [FTPControlSocket] 28 Nov 2012 12:25:39.061 : StrictReturnCodes=False
ALL [TransferBuffer] 28 Nov 2012 12:25:39.131 : Wait begin: TransferBuffer.Read (timeout=120000)


It almost seems like My dev machine connects to the server by dns name and the production machine uses the IP address.

Any help would be greatly appreciated.

17 Answers

0 votes
by (540 points)
Perhaps you should email us the server certificate and we'll take a look at it. support at enterprisedt dot com

When Exporting the Certificate to send to you I decided to try installing the certificate locally, something I have never had to do nor should I have to.
Well that made it work. Its a patchwork workaround as far as I'm concerned but at least it works.

That being said, how would a certificate cause issues between 32 and 64 bit versions of the OS? They both use the same certificates.

It is more likely that there is a difference in the Mentalis library you are using for your certificate handshake. They have not released an update in quite some time. Perhaps it has a dependency that is not being met by the 64 bit version of Windows.

This is why I use Verisign for all my production certificate needs. I have had issues with Godaddy and other smaller CA's in the past.

For me, it's time to move on to the next project.

Thanks for your help.
0 votes
by (161k points)
We have a lot of people using the product on x64, and it works on your x64 dev machine. So there must be something other than x64 causing the problem. Anyway, I'm glad you've got a workable solution for now.
0 votes
by (220 points)
Hi, i have the same problem, but i have no idea why the certified could not be verified:

DEBUG [LicenseProperties] 23 sep 2013 12:10:37.121 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 23 sep 2013 12:10:37.123 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 23 sep 2013 12:10:37.123 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or  in registry
DEBUG [LicenseProperties] 23 sep 2013 12:10:37.123 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 23 sep 2013 12:10:37.123 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 23 sep 2013 12:10:37.123 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or  in registry
DEBUG [LicenseProperties] 23 sep 2013 12:10:37.123 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 23 sep 2013 12:10:37.123 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 23 sep 2013 12:10:37.123 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or  in registry
DEBUG [LicenseProperties] 23 sep 2013 12:10:37.123 : Looking for subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO (fallback )
DEBUG [LicenseProperties] 23 sep 2013 12:10:37.124 : Found license subkey Software\Enterprise Distributed Technologies\edtFTPnet PRO
DEBUG [LicenseProperties] 23 sep 2013 12:10:37.124 : Did not find license subkeys Software\Enterprise Distributed Technologies\edtFTPnet PRO or  in registry
INFO [LicenseProperties] 23 sep 2013 12:10:49.986 : Licence expiry date: 31/12/9999
INFO [LicenseProperties] 23 sep 2013 12:10:49.986 : Production license
DEBUG [FTPConnection] 23 sep 2013 12:10:49.986 : Set LocalDirectory='D:\BanRepublica\Codigofuente\WindowsServices\ServiceTest'
DEBUG [SecureFTPConnection] 23 sep 2013 12:10:49.986 : Set LocalDirectory to D:\BanRepublica\Codigofuente\WindowsServices\ServiceTest
INFO [LicenseProperties] 23 sep 2013 12:10:49.986 : Licence expiry date: 31/12/9999
INFO [LicenseProperties] 23 sep 2013 12:10:49.986 : Production license
DEBUG [SSLFTPClient] 23 sep 2013 12:10:49.986 : Connecting to 10.150.2.67:990
DEBUG [SSLFTPControlSocket] 23 sep 2013 12:10:49.986 : waitOnShutdownSSL=True
DEBUG [HostNameResolver] 23 sep 2013 12:10:49.986 : Resolving 10.150.2.67
DEBUG [HostNameResolver] 23 sep 2013 12:10:49.986 : 10.150.2.67 resolved to 10.150.2.67
DEBUG [ExFTPControlSocket] 23 sep 2013 12:10:49.986 : Connecting directly to ftp-server 10.150.2.67:990
ALL [AsyncResult] 23 sep 2013 12:10:49.987 : WaitOne begin: 100 42
DEBUG [AsyncResult] 23 sep 2013 12:10:50.088 : WaitOne end: False 42
ALL [AsyncResult] 23 sep 2013 12:10:50.088 : WaitOne begin: 100 42
DEBUG [AsyncResult] 23 sep 2013 12:10:50.197 : WaitOne end: False 42
ALL [AsyncResult] 23 sep 2013 12:10:50.197 : WaitOne begin: 100 42
DEBUG [AsyncResult] 23 sep 2013 12:10:50.303 : WaitOne end: False 42
ALL [AsyncResult] 23 sep 2013 12:10:50.303 : WaitOne begin: 100 42
DEBUG [AsyncResult] 23 sep 2013 12:10:50.415 : WaitOne end: False 42
ALL [AsyncResult] 23 sep 2013 12:10:50.415 : WaitOne begin: 100 42
DEBUG [AsyncResult] 23 sep 2013 12:10:50.527 : WaitOne end: False 42
ALL [AsyncResult] 23 sep 2013 12:10:50.527 : WaitOne begin: 100 42
DEBUG [AsyncResult] 23 sep 2013 12:10:50.633 : WaitOne end: False 42
ALL [AsyncResult] 23 sep 2013 12:10:50.633 : WaitOne begin: 100 42
ALL [AsyncResult] 23 sep 2013 12:10:50.669 : Notify setting completed: null 42
ALL [AsyncResult] 23 sep 2013 12:10:50.669 : Notify setting wait: 42
ALL [AsyncResult] 23 sep 2013 12:10:50.670 : WaitOne end: True 42
DEBUG [SSLFTPControlSocket] 23 sep 2013 12:10:50.670 : Beginning Ssl3 handshake.
DEBUG [SecureSocket] 23 sep 2013 12:10:50.670 : Changing protocol to Ssl3
DEBUG [SSLFTPControlSocket] 23 sep 2013 12:10:50.670 : Ssl3 handshake complete.
DEBUG [FTPControlSocket] 23 sep 2013 12:10:50.670 : Setting socket timeout=120000
ALL [TransferBuffer] 23 sep 2013 12:10:50.670 : TransferBuffer timeout=120000
ALL [SocketController] 23 sep 2013 12:10:50.670 : SocketController timeout=120000
ALL [SecureSocket] 23 sep 2013 12:10:50.670 : SecureSocket timeout=120000
ALL [TransferBuffer] 23 sep 2013 12:10:50.670 : TransferBuffer timeout=120000
ALL [SocketController] 23 sep 2013 12:10:50.670 : SocketController timeout=120000
ALL [SecureSocket] 23 sep 2013 12:10:50.671 : SecureSocket timeout=120000
INFO [FTPControlSocket] 23 sep 2013 12:10:50.671 : Command encoding=System.Text.SBCSCodePageEncoding
DEBUG [ExFTPControlSocket] 23 sep 2013 12:10:50.671 : Created control-socket: SocksContext=, ProxySettings=NoProxy, RemoteHost=10.150.2.67, controlPort=990, timeout=120000
DEBUG [FTPControlSocket] 23 sep 2013 12:10:50.671 : SetActivePortRange(1024,65535). NextPort=50205
DEBUG [FTPControlSocket] 23 sep 2013 12:10:50.671 : StrictReturnCodes=False
ALL [TransferBuffer] 23 sep 2013 12:10:50.671 : Wait begin: TransferBuffer.Read (timeout=120000)
ALL [SecureSocket] 23 sep 2013 12:10:50.671 : Notify: SecureSocket.OnConnect
DEBUG [SocketController] 23 sep 2013 12:10:51.489 : Processing hello
ERROR [SocketController] 23 sep 2013 12:10:51.509 : OnReceive - caught exception - closing
ERROR [SocketController] 23 sep 2013 12:10:51.509 : EnterpriseDT.Mentalis.Security.Ssl.Shared.SslHandshakeException: The certificate could not be verified
ERROR [SocketController] 23 sep 2013 12:10:51.509 :    en QosAcBeXuvbb45KHSJb.qYZ3umeALhgZTADNQxu.nuVIpfcMw(GryNlZHqeOmowCWe3t , Boolean )
ERROR [SocketController] 23 sep 2013 12:10:51.509 :    en QosAcBeXuvbb45KHSJb.qYZ3umeALhgZTADNQxu.d33eLcoQC(cqt8Nwe0UvukX7eiRbs , Boolean )
ERROR [SocketController] 23 sep 2013 12:10:51.509 :    en Lc1AtheLH2q2TCJNd2b.r4JtwbeoXMQamH5qLyR.ProcessMessage(cqt8Nwe0UvukX7eiRbs )
ERROR [SocketController] 23 sep 2013 12:10:51.509 :    en QosAcBeXuvbb45KHSJb.qYZ3umeALhgZTADNQxu.TAxyLAhN4(ISPbbTIwjwnANWstgGy )
ERROR [SocketController] 23 sep 2013 12:10:51.509 :    en wk0xcBIICbiHCBPoinP.eBrGwoIecUA2xyW4V9r.nXsEuFGqZ(Byte[] , Int32 , Int32 )
ERROR [SocketController] 23 sep 2013 12:10:51.509 :    en m21eRYe4b6cRloHVp9M.nXNyr6eO6uQFoB6lorg.nuVIpfcMw(Byte[] , Int32 , Int32 )
ERROR [SocketController] 23 sep 2013 12:10:51.509 :    en m21eRYe4b6cRloHVp9M.nXNyr6eO6uQFoB6lorg.d33eLcoQC(Byte[] , Int32 , Int32 )
ERROR [SocketController] 23 sep 2013 12:10:51.509 :    en XqFUd6IEsWZtmofyYkY.W35pLNIYuMhY1copI1k.TAxyLAhN4(IAsyncResult )
DEBUG [SocketController] 23 sep 2013 12:10:51.510 : CloseConnection(e=The certificate could not be verified)
DEBUG [SocketController] 23 sep 2013 12:10:51.510 : Shut down socket
DEBUG [SocketController] 23 sep 2013 12:10:51.510 : Closed socket
DEBUG [TransferBuffer] 23 sep 2013 12:10:51.510 : Close() called when open
DEBUG [SecureSocket] 23 sep 2013 12:10:51.510 : OnHandshakeComplete(False,The certificate could not be verified)
ALL 
0 votes
by (161k points)
After the error above, the event ValidatingServer is fired!!! why is that? the connection never succed but the ValidationServer is ok, i am actually lost.


Validation of your server's certificate failed, but the ValidatingServer event gives you the opportunity to validate it yourself (e.g. from your own certificate store).
0 votes
by (220 points)
But, the event ValidatingServer should not fire BEFORE that the error was showed? The event ValidatingServer dont fire when method Conect() is invoked but after!!! Is it correct??
0 votes
by (51.4k points)
But, the event ValidatingServer should not fire BEFORE that the error was showed? The event ValidatingServer dont fire when method Conect() is invoked but after!!! Is it correct??


Do you mean that your call to Connect returns before the ValidatingServer event fired? Could you please post the code that calls Connect as well as your ValidatingServer event-handler?

- Hans (EnterpriseDT)
0 votes
by (220 points)
protected SecureFTPConnection _conexion;
 _conexion.AutoSecure = true;
            _conexion.CipherSuites = SSLFTPCipherSuite.ALL;
            _conexion.SSLVersion = SSLFTPSSLVersion.DETECT;
            //_conexion.Protocol = FileTransferProtocol.FTPSExplicit;
            _conexion.Protocol = FileTransferProtocol.FTPSImplicit;
            _conexion.ServerValidation = SecureFTPServerValidationType.Callback;
            _conexion.ValidatingServer += new ServerValidationHandler(_conexion_ValidatingServer);

public void Connect(Uri target, string login, string password)
        {

            //System.Diagnostics.Debug.Assert(login.Length > 0, "El login no puede ser vacio");
            if (login.Length == 0)
                throw new ArgumentNullException("cuenta de Usuario", "La cuenta de Usuario no puede ser vacia");

            //System.Diagnostics.Debug.Assert(password.Length > 0, "El password no puede ser vacio");
            if (string.IsNullOrEmpty(password) && !login.ToLower().Equals("anonymous") && (this is ClienteSFTP && (this as ClienteSFTP).PrivateKey == null))
                throw new ArgumentNullException("password", "El password no puede ser vacio");

            //TODO: Revisar porque se encuentra esta validacion aca y determinar si se puede mejorar         
            if (this.ToString() == "Olimpia.Objects.Communications.Clients.ClienteFTP")
            {
                try
                {
                    FtpWebRequest request = FtpWebRequest.Create(target) as FtpWebRequest;
                }
                catch (WebException we)
                {
                    throw new InvalidOperationException("Error al validar la direcci

Categories

...