-
Notifications
You must be signed in to change notification settings - Fork 83
how to use etcd4j with SSL #162
Comments
If you have pem certs used for your etcd-server then you can use |
yeah,i really do like this:
Qustion: |
In URI.create the URI "slash" is https: // 98.0.69.1:2379. You are using using \\ (back-slashes). |
Is it working ?? |
thank u for reminding, but it does not work either.... |
Okay. And also can you enable logging (for your java-code) to debug and attach the logs. |
"curl --cacert ca.pem --key etcd-client-key.pem --cert etcd-client.pem https://98.0.69.1:2379/v2/keys/" is ok,I try to get some logs。thank u |
Any updates/logs ? |
I am currently using this solution for keystores final KeyStore ks = KeyStore.getInstance("JKS");
final FileInputStream keyFile = new FileInputStream("/path_to_jks");
ks.load(keyFile, "jks_key".toCharArray());
final KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
kmf.init(ks, "jks_key".toCharArray());
SslContextBuilder ctxBuilder = SslContextBuilder.forClient().keyManager(kmf);
SslContext sslCtx = ctxBuilder.build();
EtcdClient etcd = new EtcdClient(sslCtx, new URI("https://10.200.1.244:2379")); Hope it helps |
the doc writes:
Setting up SSL (You need to set up the server with SSL)
SslContext sslContext = SslContext.newClientContext();
try(EtcdClient etcd = new EtcdClient(sslContext,
URI.create("https://123.45.67.89:8001"),
URI.create("https://123.45.67.90:8001"))){
// Logs etcd version
System.out.println(etcd.getVersion());
}
but this method is out-of-date
how can I generate sslContext?
The text was updated successfully, but these errors were encountered: