By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,849 Members | 2,169 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,849 IT Pros & Developers. It's quick & easy.

fsockopen via ssl

P: n/a
I'm having issues attempting to create an ssl connection using
fsockopen. my code contains the following line .

fsockopen("ssl://siteaddr",993,$errno,$errmsg,20);

error message reported:
Error: unable to connect to ssl://server.name.tld:993

When i tail the logs on the remote machine i see no connection attempts
from the web server. it appears to die before attempting to make a
connection attempt.

phpinfo indicates:

php version : 4.3.3 (win32)
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.7b 10 Apr 2003

Googling reveals , the following threads regarding the use of this dll
php4ts.dll , instead of the php_openssl.dll. When i restart apache with
the php4ts.dll loaded, i receive errors stating its not a php binary.

http://p2p.wrox.com/topic.asp?TOPIC_ID=8873
http://www.php.net/manual/en/wrappers.php (last comment on this page).

any help would be appreciated.
Thanks
--
_______ - ----------------------------------------------/-//- -
|: | (_) o jesse @ jesseward . com
|. |____ __
| | :|(__) www . jesseward . com
|_______| .| - -------------------------- -- - - -
|_____|
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a

"Jesse" <je*****@SPAMjesseward.com> wrote in message
news:10***************@nws01ykf.rim.net...
I'm having issues attempting to create an ssl connection using
fsockopen. my code contains the following line .

fsockopen("ssl://siteaddr",993,$errno,$errmsg,20);

error message reported:
Error: unable to connect to ssl://server.name.tld:993

When i tail the logs on the remote machine i see no connection attempts
from the web server. it appears to die before attempting to make a
connection attempt.

<snip>

Starting from the beginning - is there a listening port 993 open on
server.name.tld? Can you connect with anything else (even good old Telnet)?

Garp
Jul 17 '05 #2

P: n/a
Jesse <je*****@spamjesseward.com> wrote:
fsockopen("ssl://siteaddr",993,$errno,$errmsg,20);

error message reported:
Error: unable to connect to ssl://server.name.tld:993

phpinfo indicates:

php version : 4.3.3 (win32)
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.7b 10 Apr 2003


Can you say _OLD_. There have been quite a couple of vunerablilities in
openssl since.

<q src='http://www.php.net/manual/en/transports.php'>
The ssl:// and tls:// transports (available only when openssl support is
compiled into PHP) are extensions of the tcp:// transport which includes
SSL encryption. Since PHP 4.3.0 OpenSSL support must be statically
compiled into PHP, since PHP 5.0.0 it may be compiled as a module or
statically.
</q>

Since you are using a dll it's not compiled into php (hence no static),
so according to the reference you are getting the correct behavior :)

--

Daniel Tryba

Jul 17 '05 #3

P: n/a
Garp wrote:
Starting from the beginning - is there a listening port 993 open on
server.name.tld? Can you connect with anything else (even good old Telnet)?

Garp


connection to the remote server is fine via stunnel or openssl on port
993, server is actively taking connections.

Thanks,

--
_______ - ----------------------------------------------/-//- -
|: | (_) o jesse @ jesseward . com
|. |____ __
| | :|(__) www . jesseward . com
|_______| .| - -------------------------- -- - - -
|_____|
Jul 17 '05 #4

P: n/a
Daniel Tryba wrote:
Can you say _OLD_. There have been quite a couple of vunerablilities in
openssl since.
old really isnt an issue, as this is an app run behind a corporate
firewall. With limited outbound, and *no* inbound access from the
outside world.
<q src='http://www.php.net/manual/en/transports.php'>
The ssl:// and tls:// transports (available only when openssl support is
compiled into PHP) are extensions of the tcp:// transport which includes
SSL encryption. Since PHP 4.3.0 OpenSSL support must be statically
compiled into PHP, since PHP 5.0.0 it may be compiled as a module or
statically.
</q>


now the question is , how can i find a pre-built win32 binary with ssl
compiled in?

Thanks,
--
_______ - ----------------------------------------------/-//- -
|: | (_) o jesse @ jesseward . com
|. |____ __
| | :|(__) www . jesseward . com
|_______| .| - -------------------------- -- - - -
|_____|
Jul 17 '05 #5

P: n/a
Jesse <je*****@SPAMjesseward.com> wrote in message news:<10***************@nws01ykf.rim.net>...
<snip>
now the question is , how can i find a pre-built win32 binary with ssl
compiled in?


Source: <http://www.php.net/manual/en/wrappers.php>

To get the https wrapper working on Windows,
you need to replace your php4ts.dll with the
one provided at
http://ftp.proventum.net/pub/php/win32/misc/openssl/.
This is instead of using the php_openssl.dll,
so be sure to comment this extension in your php.ini.
^^^^^^^^^^^^^^^^^^

HTH

--
| Just another PHP saint |
Email: rrjanbiah-at-Y!com
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.