|
1 | 1 | /* |
2 | | - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
27 | 27 | * @test |
28 | 28 | * @bug 8134708 |
29 | 29 | * @summary Check if LDAP resources from CRLDP and AIA extensions can be loaded |
30 | | - * @run main/othervm ExtensionsWithLDAP CRLDP ldap.host.for.crldp |
| 30 | + * @run main/othervm -Djdk.net.hosts.file=${test.src}/CRLDP |
| 31 | + * -Dcom.sun.security.enableCRLDP=true |
| 32 | + * ExtensionsWithLDAP CRLDP ldap.host.for.crldp |
31 | 33 | * @modules jdk.security.auth |
32 | | - * @run main/othervm ExtensionsWithLDAP AIA ldap.host.for.aia |
| 34 | + * @run main/othervm -Djdk.net.hosts.file=${test.src}/AIA |
| 35 | + * -Dcom.sun.security.enableAIAcaIssuers=true |
| 36 | + * ExtensionsWithLDAP AIA ldap.host.for.aia |
33 | 37 | */ |
34 | 38 |
|
35 | 39 | import java.io.ByteArrayInputStream; |
36 | | -import java.io.File; |
37 | 40 | import java.io.IOException; |
38 | 41 | import java.net.InetSocketAddress; |
39 | 42 | import java.net.Socket; |
40 | | -import java.nio.file.Path; |
41 | | -import java.nio.file.Paths; |
42 | 43 | import java.security.cert.CertPath; |
43 | 44 | import java.security.cert.CertPathValidator; |
44 | 45 | import java.security.cert.CertPathValidatorException; |
@@ -132,15 +133,6 @@ public static void main(String[] args) throws Exception { |
132 | 133 | String extension = args[0]; |
133 | 134 | String targetHost = args[1]; |
134 | 135 |
|
135 | | - // enable CRLDP and AIA extensions |
136 | | - System.setProperty("com.sun.security.enableCRLDP", "true"); |
137 | | - System.setProperty("com.sun.security.enableAIAcaIssuers", "true"); |
138 | | - |
139 | | - Path hostsFilePath = Paths.get(System.getProperty("test.src", ".") |
140 | | - + File.separator + extension); |
141 | | - System.setProperty("jdk.net.hosts.file", |
142 | | - hostsFilePath.toFile().getAbsolutePath()); |
143 | | - |
144 | 136 | X509Certificate trustedCert = loadCertificate(CA_CERT); |
145 | 137 | X509Certificate eeCert = loadCertificate(EE_CERT); |
146 | 138 |
|
|
0 commit comments