# Logstash output rabbitmq

**URL:** <https://discuss.elastic.co/t/logstash-output-rabbitmq/154401>\
**Category:** Logstash\
**Created:** [October 29, 2018, 8:18am UTC](https://discuss.elastic.co/t/logstash-output-rabbitmq/154401 "2018-10-29T08:18:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![flochon](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@flochon](https://discuss.elastic.co/u/flochon)\
**Post date:** [October 29, 2018, 8:18am UTC](https://discuss.elastic.co/t/logstash-output-rabbitmq/154401/1 "2018-10-29T08:18:43Z")

</div>

Hello,

I use the output of logstash to connect to Rabbitmq with ssl.  
I have this config for Logstash :

```auto
output {
  rabbitmq {
    host => "rabbitmq"
    port => 5671
    exchange => "logstash"
    exchange_type => "direct"
    key => "logstash"
    user => "wruser"
    password => "test"
    ssl => true
    ssl_certificate_path => "/etc/pki/logstash/server.p12"
    ssl_certificate_password => "test"
    }

```

I have this config for Rabbitmq :

```auto
[
 {rabbit, [
   {tcp_listeners, [{"127.0.0.1", 5672}]}
   ,
   {num_ssl_acceptors, 10},
   {ssl_listeners, [5671]},
   {ssl_options, [
        {cacertfile,"/etc/pki/rabbitmq/ca.crt"},
        {certfile,"/etc/pki/rabbitmq/rabbitmq.crt"},
        {keyfile,"/etc/pki/rabbitmq/rabbitmq.key"},
        {verify,verify_peer},
        {fail_if_no_peer_cert,false}
   ]}
  ]}
].

```

I got this error in logsatsh :

```auto
[ERROR][logstash.outputs.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"}

```

I don't see how resolve this error. It's an error in the config or in the generation of my .p12 ?

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![hummermania](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hummermania/32/32031_2.png) [@hummermania](https://discuss.elastic.co/u/hummermania)\
**Post date:** [October 29, 2018, 9:13am UTC](https://discuss.elastic.co/t/logstash-output-rabbitmq/154401/2 "2018-10-29T09:13:29Z")

</div>

This error not in you config file, and not in your Logstash env.  
It's similar of Java environment error, and probably you can fix it like this solutions and workaround  
[Java cert](https://stackoverflow.com/questions/21076179/pkix-path-building-failed-and-unable-to-find-valid-certification-path-to-requ)

---

<div class="post-metadata">

**Author:** ![flochon](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@flochon](https://discuss.elastic.co/u/flochon)\
**Post date:** [October 29, 2018, 12:27pm UTC](https://discuss.elastic.co/t/logstash-output-rabbitmq/154401/3 "2018-10-29T12:27:14Z")

</div>

Thank you for your reply, I will check this.

I make the changes but I still the error.

Do you have command to generate well a pkcs12 correctly with a ca.crt ? I think is a part of problem

---

<div class="post-metadata">

**Author:** ![flochon](https://avatars.discourse-cdn.com/v4/letter/f/e19b73/32.png) [@flochon](https://discuss.elastic.co/u/flochon)\
**Post date:** [October 31, 2018, 8:48am UTC](https://discuss.elastic.co/t/logstash-output-rabbitmq/154401/5 "2018-10-31T08:48:34Z")

</div>

It was a problem in cert file and pkcs12.

---

<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:** [November 28, 2018, 8:48am UTC](https://discuss.elastic.co/t/logstash-output-rabbitmq/154401/6 "2018-11-28T08:48:36Z")

</div>

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