473,763 Members | 3,855 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

file_get_conten ts + https + proxy + authentificatio nS

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 authentificatio n) <-(https serveur
with authentificatio n)

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

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

Warning: file_get_conten ts(): SSL: fatal protocol error in F:\Data
\Scripts-html\php-test-file_get_conten ts\HTTP_Proxy_a uth.php on line
33
PHP Warning: file_get_conten ts(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_conten ts\HTTP_Proxy_a uth.php
on line 33

Warning: file_get_conten ts(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_conten ts\HTTP_Proxy_a uth.php on
line 33

(Error reporting is set to E_ALL)

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

Here is my script :
<?php

error_reporting (E_ALL);

$authPage = base64_encode(" xxxxxxx:xxxxxxx xx");
$authProx = base64_encode(" xxxxxxxxxx:xxxx xxxxx");

$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,ima ge/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.xx xx.fr:8080',
'request_fullur i' =true,
'method'=>'GET' ,
'header'=>$head er
);

var_dump($opts) ;

$ctx = stream_context_ create(array('h ttp'=>$opts,'ht tps'=>$opts));

echo file_get_conten ts($url,false,$ ctx);

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

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

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

Similar topics

1
5570
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"; $port = "8080"; $url = "http://www.myhost.com/folder/script.dll?variable=hello";
16
60616
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 http://xhaus.com/alan/python/proxies.html, but while many claim to support https, if you actually point your browser at the proxies, they work fine for http, but not for https pages. TIA
0
2933
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; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en
22
6173
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 revisiting the project and need to update it to Python 2.4.1. python22-win32-ssl.zip isn't compatable (duh) and I can't find a newer version. I have had a search and can't find anything to point me in the right direction. Can someone please help?
2
2896
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.1, I get the following message: ***************************************** There was an error downloading 'https://<dns name>/ScheduledJobs.asmx?op=GetMetrics'. The underlying connection was closed: Unable to connect to the remote server.
1
2887
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: http://librarian.demo.launchpad.net/3507227/urllib2_proxy_auth.py I can use urllib2 via proxy to access a https site(specifically hooking it up to libgmail). The problem is that the proxy that is accessible to me is http/port8080 only. Is it possible to use urllib2 with this proxy to access a https site?...
0
2867
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 HotSpot(TM) Client VM User home directory = C:\Documents and Settings\noa ---------------------------------------------------- c: clear console window
2
8179
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 407 Proxy Authentication Required. The same request through the old proxy succeeds. The same request to an HTTP address through the new proxy succeeds. Also, the request succeeds when forced to use Basic authentication but fails on NTLM.
0
1821
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
9566
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9389
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10003
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9943
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9828
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8825
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5410
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3918
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3529
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.