Skip to content

Commit 54b340b

Browse files
committedOct 6, 2020
8254081: java/security/cert/PolicyNode/GetPolicyQualifiers.java fails due to an expired certificate
Perform backdated validation of test certificate. Reviewed-by: mullan, xuelei
1 parent 51fdb4c commit 54b340b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎test/jdk/java/security/cert/PolicyNode/GetPolicyQualifiers.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2001, 2020, 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
@@ -30,9 +30,11 @@
3030
import java.io.File;
3131
import java.io.FileInputStream;
3232
import java.security.cert.*;
33+
import java.text.DateFormat;
3334
import java.util.Collections;
3435
import java.util.Iterator;
3536
import java.util.List;
37+
import java.util.Locale;
3638
import java.util.Set;
3739

3840
public class GetPolicyQualifiers {
@@ -52,6 +54,9 @@ public static void main(String[] args) throws Exception {
5254
PKIXParameters params = new PKIXParameters(trustAnchors);
5355
params.setPolicyQualifiersRejected(false);
5456
params.setRevocationEnabled(false);
57+
// Certificates expired on Oct 6th, 2020
58+
params.setDate(DateFormat.getDateInstance(DateFormat.MEDIUM,
59+
Locale.US).parse("July 01, 2020"));
5560
List certList = Collections.singletonList(eeCert);
5661
CertPath cp = cf.generateCertPath(certList);
5762
PKIXCertPathValidatorResult result =

0 commit comments

Comments
 (0)
Please sign in to comment.