8254081: java/security/cert/PolicyNode/GetPolicyQualifiers.java fails due to an expired certificate
Perform backdated validation of test certificate. Reviewed-by: mullan, xuelei
This commit is contained in:
parent
51fdb4c039
commit
54b340b44f
@ -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 class GetPolicyQualifiers {
|
||||
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 =
|
||||
|
Loading…
x
Reference in New Issue
Block a user