...

View Full Version : Connection Partially Encrypted.



radulema
07-25-2007, 07:59 AM
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.

_Aerospace_Eng_
07-25-2007, 08:15 AM
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

radulema
07-25-2007, 11:45 AM
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.

_Aerospace_Eng_
07-25-2007, 12:24 PM
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?

radulema
07-25-2007, 12:43 PM
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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum