title: How to GET to https with function ssh2_tunnel in php?
body: <pre><code>if ($tunnel = ssh2_tunnel($connection,'ipinfo.io', 80)){
  $request = "GET / HTTP/1.0\r\n".
              "Host: ipinfo.io\r\n".
              "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0\r\n".
              "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n".
              "Accept-Language: en-US,en;q=0.5\r\n".
              "Accept-Encoding: gzip, deflate\r\n".
              "Connection: close\r\n\r\n";
  
  fwrite($tunnel, $request);
  
  $result = '';
  
  while (!feof($tunnel)) {
      $result .= fgets($tunnel);
  }
  
  echo $result;}
  </code></pre>
  
  <p>With the above code, I can GET to <a href="http://ipinfo.io" rel="nofollow">http://ipinfo.io</a> and get its html content. However, I get nothing for https page(eg:<a href="https://www.google.com" rel="nofollow">https://www.google.com</a>). How can I get html content of https page?</p>