Bonjour,

Après beaucoup de recherches sur le net, je n'arrive pas à résoudre mon problème.

j'utilise cURL pour me connecter à un web service. Je n'ai jamais fais cela avant donc un peu compliqué. Pour rajouter un peu de difficulté, je passe par un proxy.

Lorsque je lance mon script, celui-ci me renvoi l'erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
Erreur Curl : error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:reason(1112)
Au final je ne sais pas trop d'ou vient le problème (même si j'en ai une vague idéee SSL routines), et je n'arrive pas à ma connecter.

Auriez-vous une idée qui pourrais m'orienter?

Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
 
$url = 'https://******************';
$timeout = 10;
 
$proxy_host = 'PROXY:PROXY_PORT';
$proxy_ident = 'LOGIN:PASSWORD';
 
$ch = curl_init($url);
 
//curl_setopt($ch, CURLOPT_HTTPHEADER, $header); 
 
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
 
if (preg_match('`^https://`i', $url))
{
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
}
 
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 
curl_setopt($ch, CURL_FAILONERROR, true);
curl_setopt($ch, CURLOPT_POST, true);
 
curl_setopt($ch, CURLOPT_POSTFIELDS,$header);
 
 
// Activation de l'utilisation d'un serveur proxy
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, true);
 
// Définition de l'adresse du proxy
curl_setopt($ch, CURLOPT_PROXY, $proxy_host);
 
 
 
// Définition des identifiants si le proxy requiert une identification
if ($proxy_ident)
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxy_ident);
 
$page_content = curl_exec($ch);
 
// var_dump(curl_getinfo($ch, CURLINFO_HTTP_CODE));
 
// Vérifie si une erreur survient
if(curl_errno($ch))
{
    echo 'Erreur Curl : ' . curl_error($ch);
}
 
 
curl_close($ch);
 
if(!$page_content){
	echo "<br><br>Connexion a echoue";
} else {
	echo "<br><br>Connexion reussi";
}
Je signale que lorsque je modifie l'URL, et que je mets par exemple google, la connexion et l'affichage sont OK.

Par avance, merci