Unable to establish SSL connection with ElasticSearch 6.x using Rest Client

Did you install and configure X-Pack Security in Elasticsearch?