ropensci / elastic

R client for the Elasticsearch HTTP API
https://docs.ropensci.org/elastic
Other
245 stars 58 forks source link

SSL problem while connecting to elastic ??? #295

Closed davidvilanova closed 1 year ago

davidvilanova commented 1 year ago

Hi, I´m trying to connect to elastic as follows:

host="192.168.1.210"
schema="https"
port=9200
user="myuser"
pwd="mypasswd"
index="myindex"
es_conn <- connect(host=host, 
                                    port=port, 
                                    transport_schema = schema, 
                                    errors= "complete", 
                                    warn=T, 
                                    user=user, 
                                    pwd=pwd, 
                                    force=t, 
                                    ssl_verifypeer = FALSE) 

How to fix this SSL problem ?

es_conn$es_ver() Error in curl::curl_fetch_memory(x$url$url, handle = x$url$handle) : SSL: no alternative certificate subject name matches target host name '192.168.1.210'
sckott commented 1 year ago

you can set curl options separately which may work for you, see https://github.com/ropensci/elastic/issues/293#issuecomment-1212166773

davidvilanova commented 1 year ago

Not really familiar with SSL, what these options should be ?

davidvilanova commented 1 year ago

Ok to make it work you need to add the ssl_verifyhost=F parameter.

The following will work:

es_conn <- connect(host=host, 
                                    port=port, 
                                    transport_schema = schema, 
                                    errors= "complete", 
                                    warn=T, 
                                    user=user, 
                                    pwd=pwd, 
                                    force=t, 
                                    ssl_verifypeer = FALSE,
                                    ssl_verifyhost=FALSE) 
sckott commented 1 year ago

looks like you figured it out, nice work

maelle commented 1 year ago

For info this package is looking for a new maintainer cf #292 :smile_cat:

maelle commented 1 year ago

I see this issue should have been closed.