Page 1 of 1

Connection Partially Encrypted.

Posted: Wed Jul 25, 2007 1:01 am
by radulema
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


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:

[syntax="html"]<!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:

Code: Select all

<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:[/syntax]

Code: Select all

<?
    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.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:1. Select the correct board for your query. Take some time to read the guidelines in the sticky topic.

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Wed Jul 25, 2007 1:47 pm
by feyd
The error message you are receiving normally points to the browser running over an SSL connection, but not all the content referenced by that page uses https, but http or other links. I'm not referring to links themselves, but "src" attributes and such.

Posted: Wed Jul 25, 2007 11:12 pm
by radulema
I've corrected the code and here it is:

test1.php:

Code: Select all

<!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:

Code: Select all

<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

Code: Select all

<?
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.

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, Netscape 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);

Thanks,
Cristian.