# rabbitMQ Input plugin: PKIX path building failed

**URL:** <https://discuss.elastic.co/t/rabbitmq-input-plugin-pkix-path-building-failed/160257>\
**Category:** Logstash\
**Created:** [December 10, 2018, 10:39pm UTC](https://discuss.elastic.co/t/rabbitmq-input-plugin-pkix-path-building-failed/160257 "2018-12-10T22:39:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Charles\_Peters](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@Charles\_Peters](https://discuss.elastic.co/u/Charles_Peters)\
**Post date:** [December 10, 2018, 10:39pm UTC](https://discuss.elastic.co/t/rabbitmq-input-plugin-pkix-path-building-failed/160257/1 "2018-12-10T22:39:06Z")

</div>

**Problem statement**  
Hi guys,

I receive the following error when trying to configure logstash client certificates:  
`[2018-12-10T22:10:32,949][ERROR][logstash.inputs.rabbitmq] RabbitMQ connection error, will retry. {:error_message=>"sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target", :exception=>"Java::JavaxNetSsl::SSLHandshakeException"}`

Steps to reproduce:

1. Build server from scratch with java, logstash, and certificate signed by my own ca
2. Create pkcs12 certificate:  
`openssl pkcs12 -export -out LOGSTASH-1.p12 -inkey LOGSTASH-1.key -in LOGSTASH-1.crt -passout pass:test`
3. Update trustStore  
`keytool -import -alias RMQ-master.cert -file /etc/logstash/RMQ-master.crt -keystore /opt/jre1.8.0_65/lib/security/cacerts -storepass changeit -v`
4. start logstash

Troubleshooting so far:

1. Downgraded from JRE 8\_0\_191 to JRE 8\_0\_65
2. Imported both ca.crt and RMQ-master.crt to trustStore
3. Added ca.crt to p12 certificate
4. Added RMQ-master.crt to p12 certificate
5. added the following to /etc/logstash/jvm.options:  
`-Djavax.net.ssl.trustStore=/opt/jre1.8.0_65/lib/security/cacerts`  
`-Djavax.net.ssl.trustStorePassword=changeit`

Nothing seems to be working. Can anyone help me figure out what I'm doing wrong?

- Logstash version: 6.5.2
- Operating System: AWS Linux
- Config File:  
input {  
rabbitmq {  
id =\> "\*\*\*"  
ack =\> true  
exchange =\> "\*\*\*"  
exchange\_type =\> "direct"  
queue =\> "\*\*\*"  
key =\> "\*\*\*"  
durable =\> true  
exclusive =\> false  
prefetch\_count =\> 256  
user =\> "\*\*\*"  
password =\> "Q\*\*\*W"  
host =\> "rmq-master"  
port =\> 5671  
ssl =\> true  
ssl\_version =\> "TLSv1.2"  
ssl\_certificate\_path =\> "/etc/logstash/LOGSTASH-1.p12"  
ssl\_certificate\_password =\> "test"  
passive =\> true  
vhost =\> "\*\*\*"  
heartbeat =\> 60  
arguments =\> {  
"x-max-length" =\> "250000"  
"x-overflow" =\> "reject-publish"  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 7, 2019, 10:39pm UTC](https://discuss.elastic.co/t/rabbitmq-input-plugin-pkix-path-building-failed/160257/2 "2019-01-07T22:39:10Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
