MySQL PHP & SSL

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

    #1

    MySQL PHP & SSL

    Hi All,

    I am trying to use PHP & MySQL over SSL, my issue is that the data that I am
    querying also needs to be available by non-secure as well.

    Can someone please help me in doing this.

    Cheers
    Steve


  • Gordon Burditt

    #2
    Re: MySQL PHP & SSL

    >I am trying to use PHP & MySQL over SSL, my issue is that the data that I am[color=blue]
    >querying also needs to be available by non-secure as well.
    >
    >Can someone please help me in doing this.[/color]

    You can set up the same web page on a secure server AND on an
    insecure server. With appropriate use of Apache directives and/or
    symlinks, you might even manage to use the same copy for both. It
    is unclear to me why you'd want to do this, or whether this solves
    your problem.

    The fact that you use or don't use SSL on the web site talking to
    browsers has *NOTHING WHATEVER* to do with whether you use SSL or
    not between your web site and MySQL. The two are independent
    choices.

    It is possible to use a SSL connection between the web site and
    MySQL, and use non-SSL connections between you elsewhere and MySQL.
    Just set up different logins with different privileges. Again, it
    is unclear whether this is what you want.

    Gordon L. Burditt

    Comment

    • Steven Sinfield

      #3
      Re: MySQL PHP & SSL

      Hi Gordon,

      Thanks for that information, you see I have a open table that does not
      require SSL, anyone from the net can add data to it, however. I run a query
      from that table and return values which I want to post into a secure table
      on mySQL the issue is that when I do my select statement and try to connect
      to the database under the same username it returns a blank webpage using
      SSL.

      What Im probably asking how do I run a query to my MySQL database using SSL.


      Hope that makes sense.

      Cheers
      Steven

      "Gordon Burditt" <gordonb.rt0rc@ burditt.org> wrote in message
      news:11momo7kp6 73oc0@corp.supe rnews.com...[color=blue][color=green]
      > >I am trying to use PHP & MySQL over SSL, my issue is that the data that I
      > >am
      >>querying also needs to be available by non-secure as well.
      >>
      >>Can someone please help me in doing this.[/color]
      >
      > You can set up the same web page on a secure server AND on an
      > insecure server. With appropriate use of Apache directives and/or
      > symlinks, you might even manage to use the same copy for both. It
      > is unclear to me why you'd want to do this, or whether this solves
      > your problem.
      >
      > The fact that you use or don't use SSL on the web site talking to
      > browsers has *NOTHING WHATEVER* to do with whether you use SSL or
      > not between your web site and MySQL. The two are independent
      > choices.
      >
      > It is possible to use a SSL connection between the web site and
      > MySQL, and use non-SSL connections between you elsewhere and MySQL.
      > Just set up different logins with different privileges. Again, it
      > is unclear whether this is what you want.
      >
      > Gordon L. Burditt[/color]


      Comment

      • Gordon Burditt

        #4
        Re: MySQL PHP &amp; SSL

        >Thanks for that information, you see I have a open table that does not[color=blue]
        >require SSL, anyone from the net can add data to it, however.[/color]

        You let ANYONE log directly into your MySQL server? Wow! How much
        porn, pirated software, stolen music, and stolen credit card numbers
        have been added to it?
        [color=blue]
        >I run a query
        >from that table and return values which I want to post into a secure table
        >on mySQL[/color]

        MySQL has no concept of a 'secure table', but you can restrict access
        to one to specific users.
        [color=blue]
        >the issue is that when I do my select statement and try to connect
        >to the database under the same username it returns a blank webpage using
        >SSL.[/color]

        How did you connect to MySQL using SSL? Show code. You didn't even
        TRY that, did you? You just used a https page, which has got nothing
        to do with using a SSL connection to MySQL. You should also, at
        least for debugging, generate error messages if you can't connect
        to MySQL or a query fails. Even for production use, if connecting
        to the database fails, you should tell your user that things are
        broken and to try again later.

        Remember, just because you sent a package of weapons-grade plutonium
        from Browserville to WebServerCity using armed guards and a fighter
        plane escort doesn't mean the guy at WebServerCity didn't forward
        it to MySQLTown using some kid with a wagon.
        [color=blue]
        >What Im probably asking how do I run a query to my MySQL database using SSL.[/color]

        To connect to MySQL with SSL, you need PHP 4.3.0 or later, and the
        MySQL client library installed with it must be 4.* or later. The
        distributed client library with PHP 4 is MySQL 3.23: not recent
        enough. The same applies to Windows binaries of PHP 5. Functions
        to actually specify SSL parameters don't seem to be available until
        PHP 5 with the 'mysqli' driver.

        You also need a MySQL server *compiled with SSL*.

        Gordon L. Burditt

        Comment

        Working...