Fixed a bug of ssl

fix: If the host url is like 'https://host.com' (besides, the 'https://host.com/' will work) , the function won't work properly with ssl.