php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34611 fsockopen claims to have no SSL-support
Submitted: 2005-09-23 12:55 UTC Modified: 2005-09-26 10:38 UTC
From: werner at usit dot uio dot no Assigned:
Status: Not a bug Package: OpenSSL related
PHP Version: 4.4.0 OS: Solaris
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: werner at usit dot uio dot no
New email:
PHP Version: OS:

 

 [2005-09-23 12:55 UTC] werner at usit dot uio dot no
Description:
------------
fsockopen claims that it does not have SSL-support when using it on an ssl:/-URL. phpinfo() says that OpenSSL is enabled, the OpenSSL-functions openssl_pkey_new and openssl_csr_new works, and with the exact same setup of Apache/PHP on Linux, this works great.

Reproduce code:
---------------
<?php
function callSock($adr, $port) {
  $fp = fsockopen($adr, $port, $errno, $errstr);
  if (!$fp) {
    echo "$errstr ($errno)<br/>\n";
    echo $fp;
  } else {
    echo "Kopla til $adr.<br>";
    fclose($fp);
  }
}
callSock("ssl://webmail.uio.no", 443);
callSock("webmail.uio.no", 80);
?>


Expected result:
----------------
Kopla til ssl://webmail.uio.no.
Kopla til webmail.uio.no.

Actual result:
--------------
Error 0 (0)
Kopla til webmail.uio.no.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-23 13:13 UTC] derick@php.net
What is your configure line?
 [2005-09-23 13:29 UTC] werner at usit dot uio dot no
CFLAGS='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' \
CPPFLAGS='-I/site/www/httpd/share/libjpeg/include -I/site/www/httpd/share/zlib/include' \
LDFLAGS='-L/site/www/httpd/share/libjpeg/lib -R/site/www/httpd/share/libjpeg/lib -L/site/www/httpd/share/libpng/lib -R/site/www/httpd/share/libpng/lib -L/site/www/httpd/share/zlib/lib -R/site/www/httpd/share/zlib/lib' \
CC='cc' CCC='CC' ./configure \
--with-apxs=/site/www/httpd/b_022/sbin/apxs \
--prefix=/site/www/httpd/b_022 \
--enable-calendar \
--enable-inline-optimization \
--enable-magic-quotes \
--enable-mbstring=all \
--enable-mbstr-enc-trans \
--enable-mbregex \
--enable-memory-limit \
--enable-safe-mode \
--enable-sigchild \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-track-vars \
--enable-trans-sid \
--with-config-file-path=/site/www/httpd/conf \
--with-exec-dir=/site/www/httpd/b_022/php-bin \
--with-gettext=/local \
--with-iconv=/local \
--with-jpeg-dir=/site/www/httpd/share/libjpeg \
--with-png-dir=/site/www/httpd/share/libpng \
--with-ldap=/site/ldap \
--with-mysql=/site/mysql/current \
--with-pgsql=/site/postgresql/7.3.1 \
--with-oci8=/local/opt/oraclient/product/8.1.7 \
--with-gd \
--with-openssl=/site \
--with-zlib=/site/www/httpd/share/zlib \
--with-zlib-dir=/site/www/httpd/share/zlib \
--disable-debug \
--disable-short-tags \
--disable-yp
 [2005-09-23 14:01 UTC] sniper@php.net
Check the firewall in between, works fine for me.

 [2005-09-23 14:06 UTC] werner at usit dot uio dot no
There is no firewall in between. If I use the php-binary, I get this errors/output:

Warning: fsockopen(): no SSL support in this build in /usit/saruman/gap-u1/werner/www_docs/test.php on line 4

Warning: fsockopen(): unable to connect to webmail.uio.no:443 in /usit/saruman/gap-u1/werner/www_docs/test.php on line 4
Error 0 (0)<br/>
Kopla til webmail.uio.no.<br>
 [2005-09-23 14:22 UTC] wez@php.net
You need to build the openssl extension statically into PHP for this to work.
It sounds to me like it didn't find it on your system; check the config.log to make sure.
 [2005-09-26 10:38 UTC] werner at usit dot uio dot no
It seems to me that PHP finds OpenSSL just fine. I can't find anything strange in config.log, the libphp4.so links just fine to the OpenSSL-library I wanted:

  libssl.so.0.9.6 =>       /site/lib/libssl.so.0.9.6
  libcrypto.so.0.9.6 =>    /site/lib/libcrypto.so.0.9.6

and as I said earlier other OpenSSL-functions work just fine in PHP.

Do you say there is a design-flaw in PHP that makes the dynamical linking of OpenSSL a non-option? I have built PHP on Linux the exactly same way as on Solaris, and on Linux it works. ??
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 05:01:28 2024 UTC