|
1 | 1 | package noe.tomcat.configure |
2 | 2 |
|
3 | 3 | import noe.common.utils.Platform |
| 4 | +import noe.common.utils.PathHelper |
4 | 5 |
|
5 | 6 | /** |
6 | 7 | * Abstraction for secure HTTP connector to configure Tomcat server.xml. |
@@ -53,23 +54,22 @@ public class SecureHttpConnectorTomcat extends ConnectorTomcatAbstract<SecureHtt |
53 | 54 | } |
54 | 55 |
|
55 | 56 | /** |
56 | | - * Configure secure http connector to expect certificates in ${SYSTEM_TEMP}/ssl/self_signed directory |
| 57 | + * Configure secure http connector to expect certificates in ${SYSTEM_TEMP}/ssl/proper/generated/ca/intermediate directory |
57 | 58 | * Expected names: |
58 | 59 | * <ul> |
59 | | - * <li>certificate = server.crt</li> |
60 | | - * <li>key file = server.key</li> |
61 | | - * <li>keystore = server.jks</li> |
| 60 | + * <li>certificate = localhost.server.cert.pem</li> |
| 61 | + * <li>key file = localhost.server.key.pem</li> |
| 62 | + * <li>keystore = localhost.server.keystore.jks</li> |
62 | 63 | * <li></li> |
63 | 64 | * </ul> |
64 | 65 | * Password for keystore, trustore and SSL sets to "changeit" (without apostrophes). |
65 | 66 | */ |
66 | 67 | SecureHttpConnectorTomcat setDefaultCertificatesConfiguration() { |
67 | | - String sslRoot = new File(new Platform().getTmpDir(), "ssl").getCanonicalPath() |
68 | | - String sslStringDir = new File(sslRoot, "self_signed").getCanonicalPath() |
69 | | - String sslCertificate = new File(sslStringDir, "server.crt").getCanonicalPath() |
70 | | - String sslCertificateKey = new File(sslStringDir, "server.key").getCanonicalPath() |
71 | | - String keystoreFilePath = new File(sslStringDir, "server.jks").getCanonicalPath() |
72 | | - String password = "changeit" |
| 68 | + String sslIntermediate = PathHelper.join(new Platform().getTmpDir(), "ssl", "proper", "generated", "ca", "intermediate") |
| 69 | + String sslCertificate = new File(PathHelper.join(sslIntermediate, "certs"), "localhost.server.cert.pem").getCanonicalPath() |
| 70 | + String sslCertificateKey = new File(PathHelper.join(sslIntermediate, "private"), "localhost.server.key.pem").getCanonicalPath() |
| 71 | + String keystoreFilePath = new File(PathHelper.join(sslIntermediate, "keystores"), "localhost.server.keystore.jks").getCanonicalPath() |
| 72 | + String password = "testpass" |
73 | 73 |
|
74 | 74 | setSslCertificateFile(sslCertificate) |
75 | 75 | setSslCertificateKeyFile(sslCertificateKey) |
|
0 commit comments