I am running my admin panel in HTTPS for security purpose. Everything is working fine in admin.
But getting this error, while trying to call login method to authenticate where as my secure URL is in HTTPS.
SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://domain.com/index.php/api/v2_soap/index/?wsdl=1' : failed to load external entity "https://domain.com/index.php/api/v2_soap/index/?wsdl=1
This is working fine in HTTP
$username = 'username';
$apiKey = 'apikey';
$api_url_v2 = "https://domain.com/api/v2_soap/?wsdl=1"
$cli = new SoapClient($api_url_v2);
$result = $cli->login(array('username' => $username, 'apiKey' => $apiKey));