Logstash can't connect to Elasticsearch: java.net.SocketException: Connection reset

On a Windows machine, I am trying to add some data with Logstash to Elasticsearch, using the following output configuration in logstash.conf:

output {
    elasticsearch { 
        hosts => "https://localhost:9200"
        ssl => true
        ssl_certificate_verification => false
        user => logstash
        password => logstash
        ilm_enabled => false
        index => "logstash"
      }
}

The logstash.bat executes without errors, although with some warnings.

However, from field audit_request_exception_stacktrace, I get the following in Kibana:

java.net.SocketException: Connection reset at java.base/sun.nio.ch.SocketChannelImpl.throwConnectionReset(SocketChannelImpl.java:345) at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:376) at org.elasticsearch.transport.CopyBytesSocketChannel.readFromSocketChannel(CopyBytesSocketChannel.java:141)

As shown in the following picture: