Skip to content

Commit a505a1d

Browse files
fgualliniseanjmullan
authored andcommittedSep 5, 2024
8337951: Test sun/security/validator/samedn.sh CertificateNotYetValidException: NotBefore validation
Reviewed-by: mullan
1 parent 6be9272 commit a505a1d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎test/jdk/sun/security/validator/samedn.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2010, 2024, 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,10 +62,11 @@ $KT -genkeypair -alias ca1 -dname CN=CA -keyalg rsa -sigalg md5withrsa -ext bc -
6262
$KT -genkeypair -alias ca2 -dname CN=CA -keyalg rsa -sigalg sha1withrsa -ext bc -startdate -1y
6363
$KT -genkeypair -alias user -dname CN=User -keyalg rsa
6464

65-
# 2. Signing: ca -> user
65+
# 2. Signing: ca -> user. The startdate is set to 1 minute in the past to ensure the certificate
66+
# is valid at the time of validation and to prevent any issues with timing discrepancies
6667

67-
$KT -certreq -alias user | $KT -gencert -rfc -alias ca1 > samedn1.certs
68-
$KT -certreq -alias user | $KT -gencert -rfc -alias ca2 > samedn2.certs
68+
$KT -certreq -alias user | $KT -gencert -rfc -alias ca1 -startdate -1M > samedn1.certs
69+
$KT -certreq -alias user | $KT -gencert -rfc -alias ca2 -startdate -1M > samedn2.certs
6970

7071
# 3. Append the ca file
7172

0 commit comments

Comments
 (0)
Please sign in to comment.