473,508 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

file_get_contents + https + proxy + authentificationS

Hi,

I am searching how to solve a problem and I dont find it :(
I want to access a page from a script behind a proxy :

(my script) <-(a proxy with authentification) <-(https serveur
with authentification)

-----------------------------------------------------------------

I get this error :
PHP Warning: file_get_contents(): SSL: fatal protocol error in F:\Data
\Scripts-html\php-test-file_get_contents\HTTP_Proxy_auth.php on line
33

Warning: file_get_contents(): SSL: fatal protocol error in F:\Data
\Scripts-html\php-test-file_get_contents\HTTP_Proxy_auth.php on line
33
PHP Warning: file_get_contents(https://logs.ovh.net/xxx-xxxx.xxx/
logs-12-2007/): failed to open stream: Cannot connect to HTTPS server
through proxy
in F:\Data\Scripts-html\php-test-file_get_contents\HTTP_Proxy_auth.php
on line 33

Warning: file_get_contents(https://logs.ovh.net/xxx-xxxx.xxx/
logs-12-2007/): failed to open stream: Cannot connect to HTTPS server
through proxy in F:
\Data\Scripts-html\php-test-file_get_contents\HTTP_Proxy_auth.php on
line 33

(Error reporting is set to E_ALL)

-----------------------------------------------------------------

Here is my script :
<?php

error_reporting(E_ALL);

$authPage = base64_encode("xxxxxxx:xxxxxxxxx");
$authProx = base64_encode("xxxxxxxxxx:xxxxxxxxx");

$url = 'https://logs.ovh.net/xxx-xxxx.xxx/logs-12-2007/';

$header = "Accept: text/xml,application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n"
."Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3\r\n"
."Accept-Encoding: gzip,deflate\r\n"
."Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n"
."Keep-Alive: 300\r\n"
."Proxy-Connection: keep-alive\r\n"
."Proxy-Authorization: Basic {$authProx}\r\n"
."Authorization: Basic {$authPage}";

$opts = array (
'proxy' ='tcp://xxxxx.xxx.xx.xxxx.fr:8080',
'request_fulluri' =true,
'method'=>'GET',
'header'=>$header
);

var_dump($opts);

$ctx = stream_context_create(array('http'=>$opts,'https'= >$opts));

echo file_get_contents($url,false,$ctx);

?>
-----------------------------------------------------------------

If someone see where is the problem, it would be cool ;)
thx
Dec 21 '07 #1
0 4984

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5527
by: b_prikls | last post by:
Hi all, i need your help, here is code, that makes http connection to a website throu a proxy server, and it works fine: ========================================== $proxy = "111.111.111.111";...
16
60579
by: Paul Sweeney | last post by:
Does anyone know of a working (python) https proxy which allows viewing of unencrypted data being sent from my browser to an https site? I've worked my way through most on the list at...
0
2912
by: Robert | last post by:
did you solve this problem? It seems to be still present here with py2.3.5. Robert -- From: Manish Jethani <manish.j@gmx.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;...
22
6125
by: Bloke | last post by:
Hi all. Some time ago (years) I had a script on Python 2.2 that would retieve a HTTPS web site. I used python22-win32-ssl.zip to handle the SSL aspect and it worked wonderfully. I am...
2
2882
by: MarkAurit | last post by:
I have a web service Im using on a machine via http in a dmz that works file. Im now attempting to use it in a second server, this one using https. When I attempt to add the Web Reference in vs.net...
1
2873
by: Astan Chee | last post by:
Hi again, According to https://demo.launchpad.net/products/python/+bug/56872 or more specifically, the example of its working code:...
0
2848
by: NoaGross | last post by:
Hi, I'm relly new in java and I have a problem. I'm using java applet. When using http all ok, but when trying to use https i get: Java Plug-in 1.5.0_10 Using JRE version 1.5.0_10 Java...
2
8128
by: =?Utf-8?B?TGVuc3Rlcg==?= | last post by:
A C# (.NET 2) application which uses the System.Net.HttpWebRequest object to request a resource over HTTPS is failing following the installation of a new proxy server on our internal network with...
0
1805
by: Gustavo Rahal | last post by:
Hi I'm trying to build a xmlrpc client that uses a proxy to connect to a xmlrpc server in https. I've googled and came up with a code snippet that doesn't actually work. What is missing?
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
435
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.