#012267: eZSoapClient unable to use SSL with different port than 443

Description:

    function eZSOAPClient( $server, $path = '/', $port = 80 )
    {
        $this->Login = "";
        $this->Password = "";
        $this->Server = $server;
        $this->Path = $path;
        $this->Port = $port;
        if ( is_numeric( $port ) )
            $this->Port = $port;
        elseif( strtolower( $port ) == 'ssl' )
            $this->Port = 443;
        else
            $this->Port = 80;
    }

As you may notice, this code is not so well. Better to add a separate parameter to specify the scheme (http or https).

http://en.wikipedia.org/wiki/Httpsurl says: "An https: URL may specify a TCP port; if it does not, the connection uses port 443"


Environment:

Operating System:
PHP Version: (please be specific, like '4.4.3' or '5.1.5')
Database and version:
Browser (and version):


- Attachments
issue_12267_stable39.patch (2 kb)
[Download] [Permanent Link]
Patch for stable 3.9 branch

- Comments

fixed in
trunk (4.1.0alpha1) rev. 21183
stable/4.0 (4.0.1) rev. 21184
stable/3.10 (3.10.1) rev. 21185
stable/3.9 (3.9.5) rev. 21186

#255524 by Kristof Coomans on January 22nd, 2008 [Permanent Link]

There is a BC break: if port 443 was passed before, then SSL was used by default. Now not anymore. I will fix this.

#258020 by Kristof Coomans on September 2nd, 2008 [Permanent Link]

Please test the patch for the BC break I attach here and let me know if it works as expected.

#258220 by Kristof Coomans on September 23rd, 2008 [Permanent Link]
- Attachments: » issue_12267_bc_trunk.patch (Patch for trunk (4.1.0alpha1))

The code appears to function same before, because it use HTTPS only if port parameter is set to 433. I suggest the following:


    function eZSOAPClient( $server, $path = '/', $port = 80,  $useSSL = null)
    {
        $this->Login = "";
        $this->Password = "";
        $this->Server = $server;
        $this->Path = $path;
        $this->Port = $port;
        $this->UseSSL=$useSSL;

      if ($useSSL)
       $this->UseSSL = true;
     else
       $this->UseSSL = false;
 
       if ( is_numeric( $port ) )
            $this->Port = $port;
        elseif( strtolower( $port ) == 'ssl' ){
            $this->Port = 443;
            if ($useSSL !== false)
                $this->UseSSL = true;
        }
        else
            $this->Port = 80;
    }

#258233 by Bayron Guevara on September 23rd, 2008 [Permanent Link]

Hi Bayron

I think you misunderstood something. The last patch I attached above is an additional one, it needs to be applied after the initial patch. Or did I miss something myself?

#258234 by Kristof Coomans on September 24th, 2008 [Permanent Link]

Fixed in
trunk (4.1.0alpha1) rev. 22399
stable/4.0 (4.0.2) rev. 22400

#258314 by Kristof Coomans on September 29th, 2008 [Permanent Link]

- History
Properties
Type Bug
Priority Medium
Component Misc
Affects 3.9.4
3.10.0
4.0.0 - 4.0.0release
Fix Versions 3.9.5
3.10.1
4.0.1 - 4.0.1release
4.0.2
4.1.0alpha1
Reporter Kristof Coomans
Responsible Kristof Coomans
Status 0 Closed
Resolution Fixed
Created December 17th, 2007
Updated July 29th, 2010
Resolved September 29th, 2008
 
Navigation [Permanent Link]
Previous Issue
Back to Issues List
Next Issue: #019126
  Insert metadata based on keywords