In case of https we can reset password using --url
option as below.
It doesn't throw any error and successfully changed password.
elasticsearch-reset-password -u elastic -i --url https://localhost:9200
Source: https://www.elastic.co/guide/en/elasticsearch/reference/current/trb-security-setup.html