'Basic Authentication handler is working http protocol but not with https in wso2 ei

I am following the example 'Using a Basic Auth handler' at https://docs.wso2.com/m/mobile.action#page/33136403/header/SecuringAPIs-BasicAuthUsingaBasicAuthhandler. With the same steps followed I am able to test with http protocol i.e http://localhost:8290/api/ and basic auth username:password admin:admin Now I want to do below 2 things

  1. enable https for the same if I try as same above and url 'https://localhost:8243/api' nothing happens
  2. I want to change the username:password to something else like newuser:password1

For http and https my api looks like below:

<?xml version="1.0" encoding="UTF-8"?>
<api context="/api" name="newAPI" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET" uri-template="/">
        <inSequence></inSequence>
        <outSequence/>
        <faultSequence></faultSequence>
    </resource>
    <handlers>
        <!-- <handler class="test1.BasicAuthHandler"/> -->
        <handler class="org.wso2.rest.BasicAuthHandler"/>
    </handlers>
</api>


<?xml version="1.0" encoding="UTF-8"?>
<api context="/api" name="newAPI" xmlns="http://ws.apache.org/ns/synapse">
    <resource methods="GET" uri-template="/" protocol="https">
        <inSequence></inSequence>
        <outSequence/>
        <faultSequence></faultSequence>
    </resource>
    <handlers>
        <handler class="org.wso2.rest.BasicAuthHandler"/>
    </handlers>
</api>


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source