Skip to content

Issues with SSL certificate validation in logstash output http plugin  #21

@suraj-kamath

Description

@suraj-kamath

There are two issues:

  1. ssl_certificate_validation option is not taking effect. Irrespective of whether we give the value as true or false, it is always taken as true.
  2. During SSL certification validation, logstash is doing a strict host name check. As part of this, it is not supporting wildcard certificates where CN is like *.subdomain.domain.com. Either this needs to be fixed or it would be ideal to have another option to the http plugin like, for example, "strict_host name_check" which can be set to true or false.

Logstash version :1.5.4
Http plugin version :1.1.0
java : 1.8.0_51.

Activity

ayashjorden

ayashjorden commented on Sep 28, 2015

@ayashjorden

👍
Also experienced this behaviour.
@suraj-kamath nice description of the problem :)

suraj-kamath

suraj-kamath commented on Oct 4, 2015

@suraj-kamath
Author

@logstash-dev's can we have an update here ?

ayashjorden

ayashjorden commented on Oct 4, 2015

@ayashjorden

@suraj-kamath I've found that 'ssl_certificate_validation' is used here.

Does it help?

deeptjos

deeptjos commented on Oct 23, 2015

@deeptjos

Still awaiting response on this from "logstash-dev"
Please provide an update on this issue, Is there any plan of adding the changes in latest release ?

suyograo

suyograo commented on Oct 23, 2015

@suyograo
Contributor

ssl_certificate_validation option is not taking effect. Irrespective of whether we give the value as true or false, it is always taken as true.

@suraj-kamath is this plugin still trying to do cert validation when ssl_certificate_validation is false?

clausy

clausy commented on Nov 6, 2015

@clausy

I'm getting the same error when using
ssl_certificate_validation => false
I get
"error" => "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

I just downloaded logstash 2.0 and installed the http_poller plugin

deeptjos

deeptjos commented on Jan 21, 2016

@deeptjos

@logstash-dev's Any update on this ?
Also looks like Logstash does not support SNI, Please confirm.

type0lang

type0lang commented on Mar 29, 2016

@type0lang

+1

sameerpanicker

sameerpanicker commented on Apr 4, 2016

@sameerpanicker

I am also getting the same error.

"error" => "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"

NikolaeVarius

NikolaeVarius commented on Apr 8, 2016

@NikolaeVarius

+1 Getting same issue as above

rlwmmw

rlwmmw commented on Apr 14, 2016

@rlwmmw

+1 Need a workaround!

lifeofguenter

lifeofguenter commented on May 18, 2016

@lifeofguenter

+1

sameerpanicker

sameerpanicker commented on May 19, 2016

@sameerpanicker

I was able to fix this problem. Check whether your application is using JDK or JRE. Based on that try installing the certificate in the keystore.
Let me know if you have any queries.

45 remaining items

denisvll

denisvll commented on Aug 3, 2021

@denisvll

+1

sennl

sennl commented on Aug 12, 2021

@sennl

+1

thunderwood19

thunderwood19 commented on Aug 16, 2021

@thunderwood19

Since 2015...

zgfh

zgfh commented on Aug 18, 2021

@zgfh

+1

hamparid

hamparid commented on Oct 21, 2021

@hamparid

+1 (We have wildcard Certs AND SSL settings to turn off verification in LS don't work)

M9k

M9k commented on Nov 4, 2021

@M9k

+1

smnschndr

smnschndr commented on Nov 12, 2021

@smnschndr

+1

jeffwong-mocs

jeffwong-mocs commented on Dec 13, 2021

@jeffwong-mocs

@yaoyaminaco0571 's suggestion to add truststore path worked for me in v7.16.1

@bernielomax as the error output mentioned "logstash unable to find valid certification path to requested target", you should add a fake path to it since the code needs.

The configuration is worked fine for me:

    ssl => true
    ssl_certificate_verification => false
    truststore => "/home/admin/server/elasticsearch-current/config/truststore.jks"
    truststore_password => changeit
    user => logstash
    password => logstash

If OK pls feedback. I guess it will work around the problem met in http output. @blacklobo

Caution: the jks file should be exists and readable for logstash.

yaoyaminaco0571

yaoyaminaco0571 commented on Dec 13, 2021

@yaoyaminaco0571
bastianhjaeger

bastianhjaeger commented on Dec 17, 2021

@bastianhjaeger

Facing the same issue (out of a sudden) with no cert used at all .

This is my output section:

  elasticsearch {
    hosts => "https://elastic.xxx.de:9200"
    ssl => true
    ssl_certificate_verification => false
    document_id => "someid"
    user => "user"
    password => "password"
    doc_as_upsert => true
    action => "update"
  }

And I have no truststore to set ot a cacert.

kares

kares commented on Feb 3, 2022

@kares
Contributor

A lot has been going on here over the years, but let me tackle this down:

  • the http_client mixin and thus output-http plugin at some point had the ssl_certificate_validation option
  • the ssl_certificate_validation => false had no effect and was later removed to confuse users
  • Feat: support ssl_verification_mode => 'full' / 'none' #126 added a new option ssl_verification_mode

The updated http output which can be used to disable verification (using ssl_verification_mode => none) will be part of Logstash 8.1, in the mean time try bin/logstash-plugin update logstash-output-http (which should update the plugin to >= 5.3.0)

The issue also mentions ES output with the ssl_certificate_verification => false option, the issue while similar do not have the same cause - for ES output disabling verification had some effect (allowing self-signed certificates) but did not disable verification completely. This issue has also been resolved and should be available since Logstash 7.17.0.

yaoyaminaco0571

yaoyaminaco0571 commented on Feb 3, 2022

@yaoyaminaco0571
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @kares@jordansissel@lifeofguenter@suyograo@cwstrommer

      Issue actions

        Issues with SSL certificate validation in logstash output http plugin · Issue #21 · logstash-plugins/logstash-output-http