Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Connection Partially Encrypted.

    Hi everybody,

    I have the following problem:
    when using Firefox 2.0.0.4 I've got the "Connection Partially Encrypted" message and did not know
    how to resolv this.
    I use a Linux machine, with a apache server (1.3.34), with apache_ssl packet (1.57) and PHP/4.4.7.
    I search through a lot of forums and I did not get any solution to my problem.
    I will give the source code: I have three files: test1.php, test2.php and download.php
    the utils.js file can be empty;

    test1.php:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE>Test1</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252">
    <META content="MSHTML 6.00.2900.2873" name=GENERATOR>
    <script type="text/javascript" src="utils.js"></script>
    </HEAD>
    <BODY>
    <FONT face="arial">
    <TABLE cellSpacing=0 cellPadding=0 width=640 bgColor=#ffffff border=0>
    <TR>
    <TD>
    <TABLE border=0>
    <tr>
    <td>
    <FORM METHOD="post" action="download.php">
    <INPUT TYPE="submit" VALUE="Download" name="DownloadUserConfigFile">
    </FORM>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </TABLE>
    </FONT>
    </BODY>
    </HTML>


    test2.php:

    <HTML>
    <HEAD>
    <TITLE>Test2</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252">
    <META content="MSHTML 6.00.2900.2873" name=GENERATOR>
    <script type="text/javascript" src="utils.js"></script>
    </HEAD>
    <BODY>
    <FONT face="arial">
    <TABLE cellSpacing=0 cellPadding=0 width=640 bgColor=#ffffff border=0>
    <TR>
    <TD>
    <br>
    <form name="form1" METHOD="post" ACTION="">
    <table>
    <tr>
    <td>
    <input type="submit" name="" value="Disable" >
    </td>
    </tr>
    </table>
    </form>
    </td>
    </tr>
    </TABLE>
    </FONT>
    </BODY>
    </HTML>

    download.php:

    <?
    header('Content-type: text/plain');
    header('Content-Disposition: attachment; filename="use.cfg"');
    readfile('user.cfg');
    ?>

    Please make the following test:
    http://xxx.xxx.xxx.xxx/test1.php and press Download button (open or save or cancel) the action;
    http://xxx.xxx.xxx.xxx/test2.php;
    https://xxx.xxx.xxx.xxx/test2.php after authentication, I've got the "Connection Partially Encrypted" message.

    I've tried to find the error, and I comment the <script> comamnd on both test1.php and test2.php. And it works ! But I need the functions
    from that utils.js file. How It can be resolved ?

    I've tried also to add the utils.js file using https://xxx.xxx.xxx.xxx/utils.js (when we have https access) and http://xxx.xxx.xxx.xxx/utils.js when we have http access), and it seems it is not working.
    I've look also in about:cache (firefox) to see the cache files to see from where the firefox will upload the files.
    It seems OK to me, in the http case all the files cames from the non-secure side (look also to Fetch count display).
    In the https case, all the files cames from the secure side.

    I mention that I disable the cache from firefox (Edit->Preference->Network->Cache set to 0),
    but it seems the firefox have a Memory cache also.
    With the about:cache we can see both cache's cases.

    I'm lost.

    Thanks,
    Cristian.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    I was having a similar issue recently. I had to use the full path to any files that were on the page. So changing the url to the js file should resolve part of the issue. The other would be to use the secure url to the config file though I'm not sure if readfile can use absolute urls. Your form action should also be made to use the full secure url to download.php
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the answer.

    I change all the url to point to http (when http was enable) and https (when https was enabled). But the same error I've got.

    I've replaced the readfile with:
    $fp = fopen(<path>/user.cfg, "r"); when <path> is the real path to the file.
    while (!(feof($fp))
    echo (fgets($fp, 4096));
    fclose($fp);

    Another problem I've encounter is: if I comment the header('Content-Disposition ...) command from download.php the "Connection partially encrypted" will not appear.
    But also the "Save As" window will not be efective anymore.
    Do you know another way to "Save As" window to appear (to be efective in Firefox, IE, Netsacpe etc) ?

    Note: the "Connection partially encrypted" problem appear only if you will run exacly in the way I did. If you do not press Download button, the problem will not come up. And the above problem appear ONLY in Firefox (not IE, etc);

    Cristian.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    You didn't trim out any of your code did you? Remember even links on the page need to have the secure url. Any call to a js file needs the secure url. Are you using https://urltosite.com/download.php in the form action?
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #5
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    The code I've used:

    test1.php:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE>Test1</TITLE>
    <?
    if ($_SERVER["SERVER_PORT"] == 80)
    {
    $str = "http://xxx.xxx.xxx.xxx/utils.js";
    $str1 = "http://xxx.xxx.xxx.xxx/download.php";
    }
    elseif($_SERVER["SERVER_PORT"] == 443)
    {
    $str = "https://xxx.xxx.xxx.xxx/utils.js";
    $str1 = "https://xxx.xxx.xxx.xxx/download.php";
    }
    ?>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252">
    <META content="MSHTML 6.00.2900.2873" name=GENERATOR>
    <script type="text/javascript" src="<?=$str?>"></script>
    </HEAD>
    <BODY>
    <FONT face="arial">
    <TABLE cellSpacing=0 cellPadding=0 width=640 bgColor=#ffffff border=0>
    <TR>
    <TD>
    <TABLE border=0>
    <tr>
    <td>
    <FORM METHOD="post" action="<?=$str1?>">
    <INPUT TYPE="submit" VALUE="Download" name="DownloadUserConfigFile">
    </FORM>
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </TABLE>
    </FONT>
    </BODY>
    </HTML>

    test2.php:

    <HTML>
    <HEAD>
    <TITLE>Test2</TITLE>
    <?
    if ($_SERVER["SERVER_PORT"] == 80)
    {
    $str = "http://xxx.xxx.xxx.xxx/utils.js";
    }
    elseif($_SERVER["SERVER_PORT"] == 443)
    {
    $str = "https://xxx.xxx.xxx.xxx/utils.js";
    }
    ?>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252">
    <META content="MSHTML 6.00.2900.2873" name=GENERATOR>
    <script type="text/javascript" src="<?=$str?>"></script>
    </HEAD>
    <BODY>
    <FONT face="arial">
    <TABLE cellSpacing=0 cellPadding=0 width=640 bgColor=#ffffff border=0>
    <TR>
    <TD>
    <br>
    <form name="form1" METHOD="post" ACTION="">
    <table>
    <tr>
    <td>
    <input type="submit" name="" value="Disable" >
    </td>
    </tr>
    </table>
    </form>
    </td>
    </tr>
    </TABLE>
    </FONT>
    </BODY>
    </HTML>

    download.php

    <?
    header('Content-type: text/plain');
    header('Content-Disposition: attachment; filename="user.cfg"');

    $str = "<path>/user.cfg";
    $fp = fopen($str, "r");
    while (!feof($fp))
    {
    echo (fgets($fp, 4096));
    }
    fclose($fp);
    ?>

    Still don't work. Any other ideas are welcome.

    Thanks,
    Cristian.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •