This is an automated email from the ASF dual-hosted git repository. twolf pushed a commit to branch dev_3.0 in repository https://gitbox.apache.org/repos/asf/mina-sshd.git
commit 1352b75b7ecefedee7a2554cc503869e9179a524 Author: Thomas Wolf <[email protected]> AuthorDate: Sun Oct 19 17:34:18 2025 +0200 Minor: fix validBefore in ephemeral certificate used in tests The test used validBefore(long) with a millisecond value, but it should have been seconds. Use validBefore(Instant) instead. --- .../org/apache/sshd/common/signature/OpenSshHostCertificateTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sshd-core/src/test/java/org/apache/sshd/common/signature/OpenSshHostCertificateTest.java b/sshd-core/src/test/java/org/apache/sshd/common/signature/OpenSshHostCertificateTest.java index 07942f93e..7a2f38681 100644 --- a/sshd-core/src/test/java/org/apache/sshd/common/signature/OpenSshHostCertificateTest.java +++ b/sshd-core/src/test/java/org/apache/sshd/common/signature/OpenSshHostCertificateTest.java @@ -19,10 +19,10 @@ package org.apache.sshd.common.signature; import java.security.KeyPair; +import java.time.Instant; import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.concurrent.TimeUnit; import java.util.stream.Stream; import org.apache.sshd.certificate.OpenSshCertificateBuilder; @@ -101,7 +101,7 @@ class OpenSshHostCertificateTest extends BaseTestSupport { .serial(System.currentTimeMillis()) // .publicKey(hostKeyPair.getPublic()) // .id("test-cert-" + signatureAlgorithm) // - .validBefore(System.currentTimeMillis() + TimeUnit.HOURS.toMillis(1)) // + .validBefore(Instant.now().plusSeconds(3600)) // .principals(principals) // .sign(caKey, signatureAlgorithm); hostKey = hostKeyPair;
