Quantcast
Channel: Rebex Q&A Forum - Recent questions and answers
Viewing all 3902 articles
Browse latest View live

Answered: SFTP GetFile - How to retain original date/time file when copy

$
0
0

You can instruct Rebex SFTP to restore date/time using Sftp.Settings.RestoreDateTime property.

Sample code:

using (var sftp = new Sftp())
{
    sftp.Connect("test.rebex.net");
    sftp.Login("demo", "password");

    // restore last write time in subsequent operations
    sftp.Settings.RestoreDateTime = ItemDateTimes.LastWriteTime;

    // download the file
    sftp.GetFile("readme.txt", "readme.txt");
}

error: Key exchange failed. The session was closed by the remote connection end. ?

$
0
0

why this error??
how to solve??

****this is my code:****

Dim client As Rebex.Net.Sftp = New Rebex.Net.Sftp
Dim res As Rebex.Net.SftpItemCollection

    Dim HOST_CASER As String = "ftp.caser.es"

    client.LogWriter = New Rebex.FileLogWriter("C:\MultiTarificador2016_XXX\log.txt", Rebex.LogLevel.Debug)
    client.Connect(HOST_CASER, 22)
    client.Login("user", "pass")

    res = client.GetList()

and this is my LOG:

2016-10-10 16:59:59.243 Opening log file.
2016-10-10 16:59:59.264 INFO Sftp(1)[9] Info: Connecting to ftp.caser.es:22 using Sftp 3.0.4444.0.
2016-10-10 16:59:59.339 DEBUG Sftp(1)[9] SSH: Server is 'SSH-2.0-OpenSSH6.6.1'.
2016-10-10 16:59:59.342 INFO Sftp(1)[9] SSH: Negotiation started.
2016-10-10 16:59:59.372 DEBUG Sftp(1)[9] SSH: Group exchange.
2016-10-10 16:59:59.396 DEBUG Sftp(1)[9] SSH: SSH connection closed.
2016-10-10 16:59:59.420 DEBUG Sftp(1)[9] SSH: Negotiation failed: Rebex.Net.SshException: Key exchange failed. The session was closed by the remote connection end. ---> Rebex.Net.SshException: The session was closed by the remote connection end.
en Rebex.Net.SshSession.2aErfC(OCfHX )
en gbMKS.2dBnlEZ.qzm1d(SshSession , Byte[] , Byte[] , Byte[] , Byte[] , Byte[]& , Byte[]& , Byte[]& )
en Rebex.Net.SshSession.qzm1d(Byte[] )
--- Fin del seguimiento de la pila de la excepción interna ---
en Rebex.Net.SshSession.qzm1d(Byte[] )
2016-10-10 16:59:59.423 ERROR Sftp(1)[9] SSH: Rebex.Net.SshException: Key exchange failed. The session was closed by the remote connection end. ---> Rebex.Net.SshException: The session was closed by the remote connection end.
en Rebex.Net.SshSession.2aErfC(OCfHX )
en gbMKS.2dBnlEZ.qzm1d(SshSession , Byte[] , Byte[] , Byte[] , Byte[] , Byte[]& , Byte[]& , Byte[]& )
en Rebex.Net.SshSession.qzm1d(Byte[] )
--- Fin del seguimiento de la pila de la excepción interna ---
en Rebex.Net.SshSession.qzm1d(Byte[] )
en Rebex.Net.SshSession.14Ad4fZ()
en Rebex.Net.SshSession.Negotiate()
2016-10-10 16:59:59.426 ERROR Sftp(1)[9] Info: Rebex.Net.SshException: Key exchange failed. The session was closed by the remote connection end. ---> Rebex.Net.SshException: The session was closed by the remote connection end.
en Rebex.Net.SshSession.2aErfC(OCfHX )
en gbMKS.2dBnlEZ.qzm1d(SshSession , Byte[] , Byte[] , Byte[] , Byte[] , Byte[]& , Byte[]& , Byte[]& )
en Rebex.Net.SshSession.qzm1d(Byte[] )
--- Fin del seguimiento de la pila de la excepción interna ---
en Rebex.Net.SshSession.qzm1d(Byte[] )
en Rebex.Net.SshSession.14Ad4fZ()
en Rebex.Net.SshSession.Negotiate()
en Rebex.Net.Sftp.Connect(String serverName, Int32 serverPort, SshParameters parameters)
2016-10-10 17:06:31.929 Opening log file.
2016-10-10 17:06:32.239 INFO Sftp(1)[9] Info: Connecting to ftp.caser.es:22 using Sftp 3.0.4444.0.
2016-10-10 17:06:33.420 DEBUG Sftp(1)[9] SSH: Server is 'SSH-2.0-OpenSSH
6.6.1'.
2016-10-10 17:06:33.609 INFO Sftp(1)[9] SSH: Negotiation started.
2016-10-10 17:06:34.417 DEBUG Sftp(1)[9] SSH: Group exchange.
2016-10-10 17:06:34.447 DEBUG Sftp(1)[9] SSH: SSH connection closed.
2016-10-10 17:06:34.938 DEBUG Sftp(1)[9] SSH: Negotiation failed: Rebex.Net.SshException: Key exchange failed. The session was closed by the remote connection end. ---> Rebex.Net.SshException: The session was closed by the remote connection end.
en Rebex.Net.SshSession.2aErfC(OCfHX )
en gbMKS.2dBnlEZ.qzm1d(SshSession , Byte[] , Byte[] , Byte[] , Byte[] , Byte[]& , Byte[]& , Byte[]& )
en Rebex.Net.SshSession.qzm1d(Byte[] )
--- Fin del seguimiento de la pila de la excepción interna ---
en Rebex.Net.SshSession.qzm1d(Byte[] )
2016-10-10 17:06:34.941 ERROR Sftp(1)[9] SSH: Rebex.Net.SshException: Key exchange failed. The session was closed by the remote connection end. ---> Rebex.Net.SshException: The session was closed by the remote connection end.
en Rebex.Net.SshSession.2aErfC(OCfHX )
en gbMKS.2dBnlEZ.qzm1d(SshSession , Byte[] , Byte[] , Byte[] , Byte[] , Byte[]& , Byte[]& , Byte[]& )
en Rebex.Net.SshSession.qzm1d(Byte[] )
--- Fin del seguimiento de la pila de la excepción interna ---
en Rebex.Net.SshSession.qzm1d(Byte[] )
en Rebex.Net.SshSession.14Ad4fZ()
en Rebex.Net.SshSession.Negotiate()
2016-10-10 17:06:34.944 ERROR Sftp(1)[9] Info: Rebex.Net.SshException: Key exchange failed. The session was closed by the remote connection end. ---> Rebex.Net.SshException: The session was closed by the remote connection end.
en Rebex.Net.SshSession.2aErfC(OCfHX )
en gbMKS.2dBnlEZ.qzm1d(SshSession , Byte[] , Byte[] , Byte[] , Byte[] , Byte[]& , Byte[]& , Byte[]& )
en Rebex.Net.SshSession.qzm1d(Byte[] )
--- Fin del seguimiento de la pila de la excepción interna ---
en Rebex.Net.SshSession.qzm1d(Byte[] )
en Rebex.Net.SshSession.14Ad4fZ()
en Rebex.Net.SshSession.Negotiate()
en Rebex.Net.Sftp.Connect(String serverName, Int32 serverPort, SshParameters parameters)

FTP TLS only download 63 files, then connection is closed?

$
0
0
Ftp ftp = new Ftp();
TlsParameters parameters = new TlsParameters();
parameters.CertificateVerifier = CertificateVerifier.AcceptAll;
ftp.Connect("xxx.com", 21, parameters, FtpSecurity.Explicit);
ftp.Login("xxx", "xxxxxxx");
foreach (FtpItem item in ftp.GetItems("*.csv"))
{
    ftp.Download(item.Name, LocalPath);
}

I'm using the trial of rebex ftp

Answered: Calculate MD5 remote file checksum with SFTP

Answered: Clearing the message flag from outlook

$
0
0

The problem is in the behavior of Exchange server. IMAP flags are not fully linked with their Exchange/Outlook representation. This means:

If a user sets a flag to a message in Outlook, it is not reported using IMAP protocol. However if a client sets a flag using IMAP protcol, it is shown in Outlook as well.

Similar is clearing flags. If a user in Outlook clears the flag it is still reported as Flagged in IMAP protocol. However if a flag is removed using IMAP protocol, it is also cleared in Outlook.

This is behavior of Exchange/Outlook, not the IMAP protocol. Other servers do this differently e.g. Gmail.

If your server supports keywords, I suggest you to use it. If not, you have to use something else.

For example, if you use ImapMessageFlags.Draft in the INBOX folder, the user will not see this flag (nor change it), but you will be able to search for it using IMAP protocol.

Answered: Whats is the Exception returned by Smtp.Login Method (String, SmtpAuthentication), on the access token expire?

Running multiple virtual terminal controls simultaneously in one application

$
0
0

I'm having a strange issue with running multiple instances of the Virtual Terminal control within a single application. I am writing an app that will connect to devices (routers, firewalls, switches, etc.) and run a script that pulls the configuration for each device and finally disconnects. The way it works is that each connection runs in a dynamically created form. The problem is when I try to run more than one connection at a time only the one that connects first runs, the others just sit there trying to connect. If I run them one at a time all of them work. It's as if all of the virtual terminal instances share a common backend and are conflicting with each other. I've tried substituting the Terminal Control for the Virtual Terminal control but have the same issue.

Can I only run one instance of Virtual Terminal at a time? Is there a way around that?

Nuget Packages

$
0
0

Any chance you could supply nuget packages? This would make building on my CI server so much easier.


Answered: Running multiple virtual terminal controls simultaneously in one application

$
0
0

There is no common backend for VirtualTerminal nor TerminalControl.

To test VirtualTerminal:
I bind two instances of VirtualTerminal to one Ssh object and another two instances of VirtualTerminal to one Telnet object. All four instances of VirtualTerminal are running simultaneously in four tasks without blocking each other.

To test TerminalControl:
I created a WinForm. I placed three TerminalControls on it. In Form_Load method I bind two TerminalControls to an Ssh object and one TerminalControl to Telnet object. I am able to work with all TerminalControls without blocking each other.

Moreover, I opened another form with TerminalControl when button was clicked. All terminals on all forms were working fine.

Finally, I created a form with a TerminalControl dynamically and I opened it when a button was clicked. Again, all terminals were working fine.

If you would like to see my test code, please let me know.

I think that the issue is related to the way you create or display forms. If you send me your code, I can look at it and hopefully spot something. In this case, send your project to support@rebex.net

IMAP Gmail OAuth return "Could not create SSL/TLS secure channel."

$
0
0

We are using framework 4.0 and have implemented the OAuth Gmail from this post : http://blog.rebex.net/howto-authenticate-gmail-rebex-oauth/

We have a weird issue that both function GetEmail or GetAccessToken actually work but sometimes it just failed with request error : "Could not create SSL/TLS secure channel.". It seem random but when it failed i need to restart my app to get it to work again.
I added a delegate ServicePointManager.ServerCertificateValidationCallback that always return true but the request failed from time to time.

EDIT : I found the problem and i think DEV should check it out.
My application create a session imap each time a window form is created which is the Inbox form.
The GetEmail Or GetAccessToken failed only after i use the IMAP library function like GetMailMessage. Here's why : It's seem that one of your function im guessing GetMAilMessage seems to reset or set ServicePointManager.SecurityProtocol other than tls which cause this request error when i try to open another session with the oauth function.
I fixed this by setting ServicePointManager.ServerCertificateValidationCallback and ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls in GetEmail and GetAccessToken before the query

Answered: SFTP - x509 certificate authentication

$
0
0

If you are using Rebex Tiny SFTP server, just simply store the certificates (public part = .cer or .der files) in a directory specified by userPublicKeyDir config key.

If you are using Rebex File Server component, load the certificate like this:

var certificate = Certificate.LoadDer(file);
key = new SshPublicKey(certificate);

Then associate it with a user as described at Advanced authentication provider article.

If you are using a third party SFTP server, you have to read the documentation to find out how to set up certificate authentication.

What custom essay writing services can I trust my assignment

$
0
0

I am an undergraduate from California and i have recently got an assignment for my sociology class...yesterday i was assigned to prepare an essay on self-respect and social obligation but i'm really stuck with my homework. what to do..i just wrote an outline of my essay with some good research and suggestions from my seniors but i don't think it can make impression to my teacher..i would like to know what best essay writing services can I trust my assignment?

Nuget Packages

$
0
0

Any chance you could supply nuget packages? This would make building on my CI server so much easier.

Answered: SFTP - x509 certificate authentication

$
0
0

To authenticate to an SFTP server using client x509 certificate you have to:

  1. Generate a certificate for the specified SFTP user.
  2. Store the certificate with associated private key (.pfx file) at the client side.
  3. Store the certificate (.cer or .der file) at the server side and associate it with the specified SFTP user in your SFTP server.

Then authenticate to your SFTP server using Rebex Sftp object like this:

// connect to a server
var sftp = new Rebex.Net.Sftp();
sftp.Connect(hostname, port);

// verify server's fingerprint
// ...

// load X509 certificate
Certificate x509 = Rebex.Security.Certificates.Certificate.LoadPfx(certPath, certPassword);

// wrap X509 certificate to SshPrivateKey
SshPrivateKey privateKey = new SshPrivateKey(x509);

// log in
sftp.Login(username, privateKey);

Why Rebex takes a lot of time to get emails from outlook folder?

$
0
0

I am trying to download emails from my outlook account. In my outlook account, there is 20 Inbox folder. When I try to download emails from the folder it takes a lot of times.


Imap search parameter arrived doesn't filter hours ?

$
0
0

I was using arrived parameter to only fetch email which arrived date are > to my last retrieved date, but i always getting the same old emails even if the lastretrievedate is superior to the email date why ? It look like it doesn't compare hour but just the day.

Note NOT working with EWS too

Answered: Why Rebex takes a lot of time to get emails from outlook folder?

$
0
0

Please note that downloading whole message can take a lot of time. It also downloads attachments which can be large.

I don't know what you are trying to achieve, but consider to:

  1. List messages using EwsItemFields.Fast or EwsItemFields.Defaultmessage field value.
  2. You can even use paged output.
  3. Retrieve more information about particular message using GetMessageInfo method sequentially when needed.
  4. Download whole message only when it is really necessary.

If you are still thinking that our implementation is notably slower than other .NET managed implementation, please let us know.

Get IP Address of Connected Client?

$
0
0

We're running a Rebex FileServer. It's working great. Clients can log in and upload / download files correctly. But for logging purposes, I need to get the IP address of the connected user when the file finished uploading or downloading. I have serverFileDownloaded and serverFileUploaded methods, but I can't figure out how to get the IP address there.

Also, in the Rebex logging, I see that we have unauthorized IPs trying to access us, attempting to brute-force login. Can I block them by IP, or do I have to do that at the firewall?

Server IP works for local 127.0.0.1 , but not working for IP address Comcast assigned

$
0
0

Hi Support Guru,

I have a static IP assigned by internet provider for my home internet.

But the SFTP only works for ALL local IP addresses.

So my testing client (runing from outside of my home), could not connect to the SFTP server(running on my home IP)?

any hint to solve this?

Thanks a lot,

Imamu

Is it possible to use devloped application in multiple system if im buy 1 developer license?

$
0
0

Is it possible to use devloped application in MULTIPLE system if im buy 1 developer license ('Rebex File Transfer Pack')?

Viewing all 3902 articles
Browse latest View live