#715 https 처리 할 수 있도록 수정, deprecated 표시

This commit is contained in:
akasima 2014-05-15 11:55:36 +09:00
parent 3e12f70956
commit 4778fcc122

View file

@ -8,6 +8,7 @@
* @author NAVER (developers@xpressengine.com) * @author NAVER (developers@xpressengine.com)
* @package /classes/httprequest * @package /classes/httprequest
* @version 0.1 * @version 0.1
* @deprecated
*/ */
class XEHttpRequest class XEHttpRequest
{ {
@ -24,6 +25,12 @@ class XEHttpRequest
*/ */
var $m_port; var $m_port;
/**
* target scheme
* @var string
*/
var $m_scheme;
/** /**
* target header * target header
* @var array * @var array
@ -34,10 +41,11 @@ class XEHttpRequest
* constructor * constructor
* @return void * @return void
*/ */
function XEHttpRequest($host, $port) function XEHttpRequest($host, $port, $scheme='')
{ {
$this->m_host = $host; $this->m_host = $host;
$this->m_port = $port; $this->m_port = $port;
$this->m_scheme = $scheme;
$this->m_headers = array(); $this->m_headers = array();
} }
@ -108,7 +116,13 @@ class XEHttpRequest
{ {
static $crlf = "\r\n"; static $crlf = "\r\n";
$sock = @fsockopen($this->m_host, $this->m_port, $errno, $errstr, $timeout); $scheme = '';
if($this->m_scheme=='https')
{
$scheme = 'ssl://';
}
$sock = @fsockopen($scheme . $this->m_host, $this->m_port, $errno, $errstr, $timeout);
if(!$sock) if(!$sock)
{ {
return new Object(-1, 'socket_connect_failed'); return new Object(-1, 'socket_connect_failed');