Use project-defined Java installation for keytool (elastic/elasticsearch#4066)
Companion commit for elastic/elasticsearchelastic/elasticsearch#21540 Original commit: elastic/x-pack-elasticsearch@a1c21ece25
This commit is contained in:
commit
7b165504dc
|
@ -41,7 +41,7 @@ task createNodeKeyStore(type: LoggedExec) {
|
||||||
delete nodeKeystore
|
delete nodeKeystore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
executable = 'keytool'
|
executable = new File(project.javaHome, 'bin/keytool')
|
||||||
standardInput = new ByteArrayInputStream('FirstName LastName\nUnit\nOrganization\nCity\nState\nNL\nyes\n\n'.getBytes('UTF-8'))
|
standardInput = new ByteArrayInputStream('FirstName LastName\nUnit\nOrganization\nCity\nState\nNL\nyes\n\n'.getBytes('UTF-8'))
|
||||||
args '-genkey',
|
args '-genkey',
|
||||||
'-alias', 'test-node',
|
'-alias', 'test-node',
|
||||||
|
@ -66,7 +66,7 @@ task createClientKeyStore(type: LoggedExec) {
|
||||||
delete clientKeyStore
|
delete clientKeyStore
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
executable = 'keytool'
|
executable = new File(project.javaHome, 'bin/keytool')
|
||||||
standardInput = new ByteArrayInputStream('FirstName LastName\nUnit\nOrganization\nCity\nState\nNL\nyes\n\n'.getBytes('UTF-8'))
|
standardInput = new ByteArrayInputStream('FirstName LastName\nUnit\nOrganization\nCity\nState\nNL\nyes\n\n'.getBytes('UTF-8'))
|
||||||
args '-genkey',
|
args '-genkey',
|
||||||
'-alias', 'test-client',
|
'-alias', 'test-client',
|
||||||
|
@ -91,7 +91,7 @@ task exportNodeCertificate(type: LoggedExec) {
|
||||||
delete nodeCertificate
|
delete nodeCertificate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
executable = 'keytool'
|
executable = new File(project.javaHome, 'bin/keytool')
|
||||||
args '-export',
|
args '-export',
|
||||||
'-alias', 'test-node',
|
'-alias', 'test-node',
|
||||||
'-keystore', nodeKeystore,
|
'-keystore', nodeKeystore,
|
||||||
|
@ -102,7 +102,7 @@ task exportNodeCertificate(type: LoggedExec) {
|
||||||
// Import the node certificate in the client's keystore
|
// Import the node certificate in the client's keystore
|
||||||
task importNodeCertificateInClientKeyStore(type: LoggedExec) {
|
task importNodeCertificateInClientKeyStore(type: LoggedExec) {
|
||||||
dependsOn exportNodeCertificate
|
dependsOn exportNodeCertificate
|
||||||
executable = 'keytool'
|
executable = new File(project.javaHome, 'bin/keytool')
|
||||||
args '-import',
|
args '-import',
|
||||||
'-alias', 'test-node',
|
'-alias', 'test-node',
|
||||||
'-keystore', clientKeyStore,
|
'-keystore', clientKeyStore,
|
||||||
|
@ -122,7 +122,7 @@ task exportClientCertificate(type: LoggedExec) {
|
||||||
delete clientCertificate
|
delete clientCertificate
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
executable = 'keytool'
|
executable = new File(project.javaHome, 'bin/keytool')
|
||||||
args '-export',
|
args '-export',
|
||||||
'-alias', 'test-client',
|
'-alias', 'test-client',
|
||||||
'-keystore', clientKeyStore,
|
'-keystore', clientKeyStore,
|
||||||
|
@ -133,7 +133,7 @@ task exportClientCertificate(type: LoggedExec) {
|
||||||
// Import the client certificate in the node's keystore
|
// Import the client certificate in the node's keystore
|
||||||
task importClientCertificateInNodeKeyStore(type: LoggedExec) {
|
task importClientCertificateInNodeKeyStore(type: LoggedExec) {
|
||||||
dependsOn exportClientCertificate
|
dependsOn exportClientCertificate
|
||||||
executable = 'keytool'
|
executable = new File(project.javaHome, 'bin/keytool')
|
||||||
args '-import',
|
args '-import',
|
||||||
'-alias', 'test-client',
|
'-alias', 'test-client',
|
||||||
'-keystore', nodeKeystore,
|
'-keystore', nodeKeystore,
|
||||||
|
|
Loading…
Reference in New Issue