Logstash is unable to send data when Elastic is configured with SSL in 7.1

An update: Logstash with output as elasticsearch works fine with the ca.crt generated as per this post, where as it does not work for logstash input as elasticsearch.

Logstash working conf as output:

input {
    stdin {} 
}
output {
	stdout {codec => rubydebug}
	elasticsearch {
		hosts => ["https://172.31.28.36:9200"]
		cacert => "/etc/kibana/ca.crt"
	}
}

Logstash input conf which does not works:

input {
	stdin {} 
	elasticsearch {
	    hosts => "https://172.31.28.36:9200"
    	index => "twitter1"
    	ssl => "true"
    	ca_file => "/etc/kibana/ca.crt"
  	}
}
output {
	stdout {codec => rubydebug}
	elasticsearch {
		hosts => ["https://172.31.28.36:9200"]
		cacert => "/etc/kibana/ca.crt"
	}
}

Any thought why same cert does not work for input?