Skip to content

Commit 0972ba6

Browse files
author
Hai-May Chao
committed
8371383: Test sun/security/tools/jarsigner/DefaultOptions.java failed due to CertificateNotYetValidException
Reviewed-by: weijun
1 parent 45246bc commit 0972ba6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/jdk/sun/security/tools/jarsigner/DefaultOptions.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -62,7 +62,10 @@ public static void main(String[] args) throws Throwable {
6262
keytool("-genkeypair -dname CN=CA -alias ca -keyalg rsa -ext bc:c")
6363
.shouldHaveExitValue(0);
6464
keytool("-alias a -certreq -file a.req");
65-
keytool("-alias ca -gencert -infile a.req -outfile a.cert");
65+
66+
// The start date is set to -1M to prevent the certificate not yet
67+
// valid during fast enough execution.
68+
keytool("-alias ca -gencert -infile a.req -outfile a.cert -startdate -1M");
6669
keytool("-alias a -import -file a.cert").shouldHaveExitValue(0);
6770

6871
Files.write(Path.of("js.conf"), List.of(

0 commit comments

Comments
 (0)