Merge pull request elastic/elasticsearch#1137 from rmuir/ip6_localhost
fix smoke-test-plugins-ssl to work with ip6-localhost Original commit: elastic/x-pack-elasticsearch@ebdb867e90
This commit is contained in:
commit
e574552288
|
@ -18,6 +18,17 @@ task createKey(type: LoggedExec) {
|
|||
project.delete(keystore.parentFile)
|
||||
keystore.parentFile.mkdirs()
|
||||
}
|
||||
String subjectAlternateNames = 'san=dns:localhost,ip:127.0.0.1'
|
||||
// some machines have a different name for ipv6 loopback,
|
||||
// at least on ubuntu its ip6-localhost
|
||||
try {
|
||||
String localhost6 = InetAddress.getByName("::1").getCanonicalHostName()
|
||||
if (!localhost6.equals("localhost")) {
|
||||
subjectAlternateNames += ",dns:" + localhost6
|
||||
}
|
||||
} catch (UnknownHostException ok) {
|
||||
// e.g. no ipv6 support
|
||||
}
|
||||
executable = 'keytool'
|
||||
standardInput = new ByteArrayInputStream('FirstName LastName\nUnit\nOrganization\nCity\nState\nNL\nyes\n\n'.getBytes('UTF-8'))
|
||||
args '-genkey',
|
||||
|
@ -26,7 +37,7 @@ task createKey(type: LoggedExec) {
|
|||
'-keyalg', 'RSA',
|
||||
'-keysize', '2048',
|
||||
'-validity', '712',
|
||||
'-ext', 'san=dns:localhost,ip:127.0.0.1',
|
||||
'-ext', subjectAlternateNames,
|
||||
'-storepass', 'keypass'
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
package org.elasticsearch.watcher.test.rest;
|
||||
package org.elasticsearch.smoketest;
|
||||
|
||||
import com.carrotsearch.randomizedtesting.annotations.Name;
|
||||
import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* or more contributor license agreements. Licensed under the Elastic License;
|
||||
* you may not use this file except in compliance with the Elastic License.
|
||||
*/
|
||||
package org.elasticsearch.watcher.test.rest;
|
||||
package org.elasticsearch.smoketest;
|
||||
|
||||
import org.elasticsearch.test.rest.RestTestCandidate;
|
||||
|
||||
|
|
Loading…
Reference in New Issue