diff -u -r1.1.2.1 class.net_http_client.inc.php --- phpgwapi/inc/class.net_http_client.inc.php 27 Apr 2003 21:49:51 -0000 1.1.2.1 +++ phpgwapi/inc/class.net_http_client.inc.php 13 Nov 2003 12:03:50 -0000 @@ -273,7 +273,19 @@ { if( $this->debug & DBGTRACE ) echo "Connect( $host, $port ) \n"; - $this->url['scheme'] = "http"; + $where = explode(':',$GLOBALS['phpgw_info']['server']['files_dir']); + switch ( $where[0] ) + { + case 'http': + $this->url['scheme'] = 'http'; + break; + case 'https' : + $this->url['scheme'] = 'https'; + break; + default: + $this->url['scheme'] = 'http'; + break; + } $this->url['host'] = $host; if( $port != NULL ) $this->url['port'] = $port; @@ -663,7 +675,29 @@ $host = $this->url['host']; $port = $this->url['port']; } - if( $port == "" ) $port = 80; + + $where = explode(':',$GLOBALS['phpgw_info']['server']['files_dir']); + switch ( $where[0] ) + { + case 'http': + $this->url['scheme'] = 'http'; + break; + case 'https' : + $this->url['scheme'] = 'https'; + break; + default: + $this->url['scheme'] = 'http'; + break; + } + if( $this->url['scheme'] == 'http' ) + { + if( $port == "" ) $port = 80; + } + elseif( $this->url['scheme'] == 'https' ) + { + if ( $port == "" || $port == 80) $port = 443; + $host = 'ssl://'.$host; + } $this->socket = fsockopen( $host, $port, &$this->reply, &$this->replyString ); if( $this->debug & DBGSOCK ) echo "connexion( $host, $port) - $this->socket\n"; if( ! $this->socket ) {