|  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.
Block user comment
Status: Assign to:
Bug Type:
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
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:
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>";
callSock("ssl://", 443);
callSock("", 80);

Expected result:
Kopla til ssl://
Kopla til

Actual result:
Error 0 (0)
Kopla til


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-23 13:13 UTC]
What is your configure line?
 [2005-09-23 13:29 UTC] werner at usit dot uio dot no
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 \
 [2005-09-23 14:01 UTC]
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 in /usit/saruman/gap-u1/werner/www_docs/test.php on line 4
Error 0 (0)<br/>
Kopla til<br>
 [2005-09-23 14:22 UTC]
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 links just fine to the OpenSSL-library I wanted: =>       /site/lib/ =>    /site/lib/

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-2022 The PHP Group
All rights reserved.
Last updated: Fri Oct 07 15:05:53 2022 UTC