fsockopen via ssl

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jesse

    #1

    fsockopen via ssl

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

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

    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
    |_______| .| - -------------------------- -- - - -
    |_____|
  • Garp

    #2
    Re: fsockopen via ssl


    "Jesse" <jesseNO@SPAMje sseward.com> wrote in message
    news:1083616140 .197365@nws01yk f.rim.net...[color=blue]
    > I'm having issues attempting to create an ssl connection using
    > fsockopen. my code contains the following line .
    >
    > fsockopen("ssl://siteaddr",993,$ errno,$errmsg,2 0);
    >
    > 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.
    >[/color]
    <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


    Comment

    • Daniel Tryba

      #3
      Re: fsockopen via ssl

      Jesse <jesseNO@spamje sseward.com> wrote:[color=blue]
      > fsockopen("ssl://siteaddr",993,$ errno,$errmsg,2 0);
      >
      > 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[/color]

      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

      Comment

      • Jesse

        #4
        Re: fsockopen via ssl

        Garp wrote:
        [color=blue]
        > 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
        >[/color]

        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
        |_______| .| - -------------------------- -- - - -
        |_____|

        Comment

        • Jesse

          #5
          Re: fsockopen via ssl

          Daniel Tryba wrote:
          [color=blue]
          > Can you say _OLD_. There have been quite a couple of vunerablilities in
          > openssl since.[/color]

          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.
          [color=blue]
          > <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>
          >[/color]

          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
          |_______| .| - -------------------------- -- - - -
          |_____|

          Comment

          • R. Rajesh Jeba Anbiah

            #6
            Re: fsockopen via ssl

            Jesse <jesseNO@SPAMje sseward.com> wrote in message news:<108367456 5.915923@nws01y kf.rim.net>...
            <snip>
            [color=blue]
            > now the question is , how can i find a pre-built win32 binary with ssl
            > compiled in?[/color]

            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

            Comment

            Working...