[ 
https://issues.apache.org/jira/browse/BEAM-10723?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17494733#comment-17494733
 ] 

Beam JIRA Bot commented on BEAM-10723:
--------------------------------------

This issue is assigned but has not received an update in 30 days so it has been 
labeled "stale-assigned". If you are still working on the issue, please give an 
update and remove the label. If you are no longer working on the issue, please 
unassign so someone else may work on it. In 7 days the issue will be 
automatically unassigned.

> SSL authentication key set to trustMaterial instead of keyMaterial
> ------------------------------------------------------------------
>
>                 Key: BEAM-10723
>                 URL: https://issues.apache.org/jira/browse/BEAM-10723
>             Project: Beam
>          Issue Type: Bug
>          Components: io-java-elasticsearch
>    Affects Versions: 2.19.0
>            Reporter: Marek Simunek
>            Assignee: Marek Simunek
>            Priority: P2
>              Labels: stale-assigned
>          Time Spent: 1h 20m
>  Remaining Estimate: 0h
>
> If I set 
> ElasticsearchIO.ConnectionConfiguration#withKeystorePath
> the keystore is set to trustMaterial which I think is wrong, because this 
> keystore is suppose to be truststore for certificates.
> So if I use keyStoreKey instead of username and pass:
> {code:java}
>   ElasticsearchIO.write()
>       .withConnectionConfiguration(
>       ElasticsearchIO.ConnectionConfiguration
>           .create(config.addresses().toArray(new String[0]), config.index(), 
> config.type())
>       .withKeystorePath(config.keystorePath())
>         .withKeystorePassword("somepassword")
>         .withTrustSelfSignedCerts(true));
> {code}
> I cannot authenticate.
> I got
> {code:java}
> Caused by: javax.net.ssl.SSLException: Received fatal alert: bad_certificate
> {code}
> because the authetication key is set to trustMaterial instead of keyMaterial
> {code:java}
> SSLContexts.custom().loadTrustMaterial(keyStore, trustStrategy).build();
> {code}
> via 
> [code|https://github.com/apache/beam/blob/release-2.19.0/sdks/java/io/elasticsearch/src/main/java/org/apache/beam/sdk/io/elasticsearch/ElasticsearchIO.java#L439]
> I am working on fix



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to