JarAsh Posted May 27, 2015 Share Posted May 27, 2015 Bonjour, J'ai besoin d'envoyer des infos via Soap sur un serveur distant en https. Pour cela j'utilise nusoap_client_mime dont voici le code : $params = array(...);$url = "http://...'>http://...'>http://...'>http://... Error (113): No route to hostok Il me met dans le message l'URL en http alors que je demande du https :/ A noter que mon code initial fonctionne très bien avec une adresse en http://. Ca viendrait donc de la connexion avec SSL mas comment faire pour y arriver ? Merci pour votre aide. Link to comment Share on other sites More sharing options...
RinDman Posted May 27, 2015 Share Posted May 27, 2015 Le curl est bien initialisé, etc ? Sur stackoverflow, j'ai trouvé un sujet qui traite d'utiliser soap en https : http://stackoverflow.com/questions/11676392/how-to-send-soap-request-with-ssl-certificate-in-php Le serveur est bien configuré ? Bon courage. Link to comment Share on other sites More sharing options...
JarAsh Posted May 28, 2015 Author Share Posted May 28, 2015 Hello, Tu entends quoi par serveur bien configuré ? Quand je fais juste un curl(), j'arrive à récupérer les données de l'URL comme ceci : $options = array( CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSLVERSION => 3);$ch = curl_init( $url );curl_setopt_array( $ch, $options );$content = curl_exec( $ch );curl_close( $ch ); Ma variable $content récupère bien le contenu de l'URL. Je ne sais pas si je pars dans la bonne direction là :/ Sinon j'avais déjà essayé avec un certificat, mais j'avais le même soucis de connexion : curl_setopt($curl, CURLOPT_CAPATH, "chemin_vers_fichier_pem"); Link to comment Share on other sites More sharing options...
beankylla Posted May 28, 2015 Share Posted May 28, 2015 petite question bete mais le SSL est bien configuré sur le serveur ? Link to comment Share on other sites More sharing options...
JarAsh Posted May 28, 2015 Author Share Posted May 28, 2015 Oui :) Link to comment Share on other sites More sharing options...
RinDman Posted May 28, 2015 Share Posted May 28, 2015 $content contient quoi comme info ? La réponse mets combien de temps en moyenne ? Ajoute l'option pour avoir l'entête et exécute à nouveau ton script php, normalement avec firebug ou autre tu devrais avoir un log plus détaillé. Autre piste, modifie le timeout du curl, mets le à 60 sec. Link to comment Share on other sites More sharing options...
JarAsh Posted May 28, 2015 Author Share Posted May 28, 2015 Ok résolu de mon côté ^^ Voici la configuration utilisée : $client->setCurlOption(CURLOPT_POST, true); et : $client->setCurlOption(CURLOPT_SSL_VERIFYPEER, false);$client->setCurlOption(CURLOPT_SSLVERSION, 3); Merci à vous. Link to comment Share on other sites More sharing options...
JarAsh Posted May 28, 2015 Author Share Posted May 28, 2015 En fait j'ai encore une question ^^ Mon fichier est envoyé en : Content-Transfer-Encoding: base64 Et je dois le passer en utf8, comment faire ? Merci ! Link to comment Share on other sites More sharing options...
RinDman Posted May 28, 2015 Share Posted May 28, 2015 curl_setopt($ch, CURLOPT_ENCODING ,""); Au pire, fais un effort et consulte le manuel php.net dans la section cURL. Edit : D'après la doc, c'est que gzip, stream ou autre. L'UTF8, ça dépendra l'origine du fichier, il doit être enregistré lui mm en utf8 point. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.