Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/Renci.SshNet.IntegrationTests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RUN apk update && apk upgrade --no-cache && \
# Set the default RSA key
echo 'HostKey /etc/ssh/ssh_host_rsa_key' >> /etc/ssh/sshd_config && \
echo 'TrustedUserCAKeys /etc/ssh/user-ca.pub' >> /etc/ssh/sshd_config && \
echo 'RekeyLimit 1M 0' >> /etc/ssh/sshd_config && \
chmod 646 /etc/ssh/sshd_config && \
# install and configure sudo
apk add --no-cache sudo && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -482,5 +482,25 @@ public async Task Test_Sftp_UploadFileAsync_UploadProgress()
Assert.IsTrue(callbackCalled);
}
}

#if NET
[TestMethod]
public async Task Test_SftpUpload_WithLowRekeyLimit()
{
using (var sftp = new SftpClient(SshServerHostName, SshServerPort, User.UserName, User.Password))
{
await sftp.ConnectAsync(CancellationToken.None);

await Parallel.ForEachAsync(Enumerable.Range(0, 10), async (i, ct) =>
{
var filename = Path.GetTempFileName();
int testFileSizeMB = 100;
CreateTestFile(filename, testFileSizeMB);
using var fileStream = File.OpenRead(filename);
await sftp.UploadFileAsync(fileStream, "test" + i, ct);
});
}
}
#endif
}
}
1 change: 1 addition & 0 deletions test/Renci.SshNet.TestTools.OpenSSH/SshdConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ private static void ProcessGlobalOption(SshdConfig sshdConfig, string line)
case "PasswordAuthentication":
case "GatewayPorts":
case "Include":
case "RekeyLimit":
break;
default:
throw new NotSupportedException($"Global option '{name}' is not supported.");
Expand Down
Loading