|
Publicité ' | |||||||||||||||||||||||
|
|
#1 |
|
Invité de passage
![]() Inscription : mars 2008 Messages : 4 ![]() |
Bonjour,
J'ai un projet à réaliser avec la fac qui consiste à rendre accessible google calendar aux non-voyants. Pour cela j'ai utilisé l'API google et zend framework. Débutant dans la programmation internet, je n'ai pas réussi à résoudre mon problème, malgré mes recherches sur les nombreux forums. Mon problème est le suivant, lors de l'authentification, un message d'erreur s'affiche: Fatal error: Uncaught exception 'Zend_Gdata_App_HttpException' with message 'Unable to Connect to ssl://www.google.com:443. Error #22: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?' in C:\wamp\www\gapa\Zend\Gdata\AuthSub.php:114 Stack trace: #0 C:\wamp\www\gapa\authentification.php(56): Zend_Gdata_AuthSub::getAuthSubSessionToken('CLDG0OHqBBDbi43...') #1 C:\wamp\www\gapa\authentification.php(70): getAuthSubHttpClient() #2 {main} thrown in C:\wamp\www\gapa\Zend\Gdata\AuthSub.php on line 114 Je vous remercie par avance quelque soit l'aide que vous pourrez m'apportez. |
|
|
00
|
|
|
#2 |
|
Nouveau Membre du Club
![]() Inscription : décembre 2007 Messages : 36 ![]() |
Et si tu remplaces ssl://www.google.com par https://www.google.com/ ?
|
|
|
00
|
|
|
#3 |
|
Invité de passage
![]() Inscription : mars 2008 Messages : 4 ![]() |
Tout d'abord, merci pour ta réponse rapide. En faite, le code est le suivant et à aucun moment je ne fait de ssl mais en même temps j'ai repris entièrement le code de l'API et je dois avouer que certaines lignes restent un grand mystère...
<?php require_once 'Zend/Loader.php'; Zend_Loader::loadClass('Zend_Gdata'); Zend_Loader::loadClass('Zend_Gdata_AuthSub'); Zend_Loader::loadClass('Zend_Gdata_Calendar'); Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); Zend_Loader::loadClass('Zend_Http_Client'); /** Retrieve the current URL so that the AuthSub server knows where to * redirect the user after authentication is complete. */ function getCurrentUrl(){ global $_SERVER; // Filter php_self to avoid a security vulnerability. $php_request_uri = htmlentities(substr($_SERVER['REQUEST_URI'], 0, strcspn($_SERVER['REQUEST_URI'], "\n\r")), ENT_QUOTES); if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') { $protocol = 'https://'; } else { $protocol = 'http://'; } $host = $_SERVER['HTTP_HOST']; if ($_SERVER['HTTP_PORT'] != '' && (($protocol == 'http://' && $_SERVER['HTTP_PORT'] != '80') || ($protocol == 'https://' && $_SERVER['HTTP_PORT'] != '443'))) { $port = ':' . $_SERVER['HTTP_PORT']; } else { $port = ''; } return $protocol . $host . $port . $php_request_uri; } /** Obtain an AuthSub authenticated HTTP client, redirecting the user to the * AuthSub server to login if necessary. */ function getAuthSubHttpClient(){ global $_SESSION, $_GET; // If there is no AuthSub session or one-time token waiting for us, // redirect the user to the AuthSub server to get one. if (!isset($_SESSION['sessionToken']) && !isset($_GET['token'])) { // Parameters to give to AuthSub server $next = getCurrentUrl(); $scope = "http://www.google.com/calendar/feeds/"; $secure = false; $session = true; // Redirect the user to the AuthSub server to sign in $authSubUrl = Zend_Gdata_AuthSub::getAuthSubTokenUri($next,$scope,$secure,$session); header("HTTP/1.0 307 Temporary redirect"); header("Location: " . $authSubUrl); exit(); } // Convert an AuthSub one-time token into a session token if needed if (!isset($_SESSION['sessionToken']) && isset($_GET['token'])) { $_SESSION['sessionToken'] = Zend_Gdata_AuthSub::getAuthSubSessionToken($_GET['token']); } // At this point we are authenticated via AuthSub and can obtain an // authenticated HTTP client instance // Create an authenticated HTTP client $client = Zend_Gdata_AuthSub::getHttpClient($_SESSION['sessionToken']); return $client; } // -> Script execution begins here <- // Make sure http://code.google.com/apis/gdata/re...ml#Queriesthat the user has a valid session, so we can record the // AuthSub session token once it is available. session_start(); // Create an instance of the Calendar service, redirecting the user // to the AuthSub server if necessary. $service = new Zend_Gdata_Calendar(getAuthSubHttpClient()); ?> |
|
|
00
|
|
|
#4 |
|
Invité de passage
![]() Inscription : mars 2008 Messages : 4 ![]() |
J'ai réussi à résoudre mon problème. Cela ne venait pas de ce code mais de httpd.conf de apache et php.ini
|
|
|
00
|
|
|
#5 |
|
Invité de passage
![]() Inscription : mars 2008 Messages : 4 ![]() |
Merci quand même de ton aide !!
|
|
|
00
|
|
|
#6 |
|
Invité de passage
![]() Inscription : mai 2011 Messages : 1 ![]() |
Bonjour,
j'ai eu le meme probleme que vous, aparament vous avez reglé le probleme en appliquant des modification au niveau de httpd.conf et de apache et php.ini, que ce que vous avez fait exactement !! merci d'avances |
|
|
00
|
Copyright © 2000-2012 - www.developpez.com