Skip to content
Permalink
Browse files
8254081: java/security/cert/PolicyNode/GetPolicyQualifiers.java fails…
… due to an expired certificate

Perform backdated validation of test certificate.

Reviewed-by: mullan, xuelei
  • Loading branch information
rhalade committed Oct 6, 2020
1 parent 51fdb4c commit 54b340b44f1f3dca2c3f3e8cd2abd8196e0027d8
Showing with 6 additions and 1 deletion.
  1. +6 −1 test/jdk/java/security/cert/PolicyNode/GetPolicyQualifiers.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2008, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -30,9 +30,11 @@
import java.io.File;
import java.io.FileInputStream;
import java.security.cert.*;
import java.text.DateFormat;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Set;

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

1 comment on commit 54b340b

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot commented on 54b340b Oct 6, 2020

Please sign in to comment.