SSL error when posting new entry

9

Today I found an error when using the Zend to publish in my blog blogger. Using PHP this is the code:

<?php
set_time_limit(0);
date_default_timezone_set('America/Argentina/Buenos_Aires');
if (isset($_POST['submit'])) {

  // load Zend Gdata libraries
  require_once 'Zend/Loader.php';
  Zend_Loader::loadClass('Zend_Gdata');
  Zend_Loader::loadClass('Zend_Gdata_Query');
  Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
  Zend_Loader::loadClass('Zend_Gdata_Feed');

  // set credentials for ClientLogin authentication
  $user = "xxxxxx@gmail.com";
  $pass = "xxxxxxx";

  // set blog id
  $id = 'xxxxxxxxxxxxxxxx';

  try {
    // perform login 
    // initialize service object
    $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, 'blogger');
    $service = new Zend_Gdata($client);

    // create a new entry object
    // populate it with user input    
    $uri = 'http://www.blogger.com/feeds/' . $id . '/posts/default';
    $entry = $service->newEntry();
    $entry->title = $service->newTitle($_POST['title']);
    $entry->content = $service->newContent($_POST['body']);
    $entry->published = $service->newPublished(date(DATE_ATOM,time()));
    $entry->category = array($service->newCategory('seno','http://www.blogger.com/atom/ns#'), $service->newCategory('seno', 'http://www.blogger.com/atom/ns#'));
    $entry->content->setType('text');

    // save entry to server
    // return unique id for new post
    $response = $service->insertEntry($entry, $uri);
    $arr = explode('-', $response->getId());
    $id = $arr[2];
    echo 'Successfully added post with ID: ' . $id;

  } catch (Exception $e) {
    die('ERROR:' . $e->getMessage());  
  }
}
?>
<html>
  <head></head>
  <body>
    <h2>Add New Post</h2>
    <form method="post">
      Title: <br/> <input type="text" name="title"
       size="50" /> <br/>
      Body: <br/> <textarea name="body" cols="40"
       rows="10"> </textarea> <br/>
      <input type="submit" name="submit" value="Post" />
    </form>
  </body>
</html>

That's the way I use to post a new post or that I pretended until I found this error:

  

ERROR: Unable to Connect to ssl: //www.blogger.com: 443. Error # 0:

But all this:

( ! ) Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in C:\wamp\www\blogger\Zend\Validate\Hostname.php on line 553
Call Stack
#   Time    Memory  Function    Location
1   0.0000  368432  {main}( )   ...\Post.php:0
2   0.1875  1679928 Zend_Gdata_ClientLogin::getHttpClient( )    ...\Post.php:25
3   0.1875  1681136 Zend_Gdata_HttpClient->setUri( )    ...\ClientLogin.php:106
4   0.1875  1681136 Zend_Uri::factory( )    ...\Client.php:305
5   0.1875  1681952 Zend_Uri_Http->__construct( )   ...\Uri.php:143
6   0.1875  1682552 Zend_Uri_Http->valid( ) ...\Http.php:154
7   0.1875  1682552 Zend_Uri_Http->validateHost( )  ...\Http.php:277
8   0.1875  1703688 Zend_Validate_Hostname->isValid( )  ...\Http.php:445
9   0.1875  1704120 iconv_set_encoding ( )  ...\Hostname.php:553

( ! ) Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in C:\wamp\www\blogger\Zend\Validate\Hostname.php on line 649
Call Stack
#   Time    Memory  Function    Location
1   0.0000  368432  {main}( )   ...\Post.php:0
2   0.1875  1679928 Zend_Gdata_ClientLogin::getHttpClient( )    ...\Post.php:25
3   0.1875  1681136 Zend_Gdata_HttpClient->setUri( )    ...\ClientLogin.php:106
4   0.1875  1681136 Zend_Uri::factory( )    ...\Client.php:305
5   0.1875  1681952 Zend_Uri_Http->__construct( )   ...\Uri.php:143
6   0.1875  1682552 Zend_Uri_Http->valid( ) ...\Http.php:154
7   0.1875  1682552 Zend_Uri_Http->validateHost( )  ...\Http.php:277
8   0.1875  1703688 Zend_Validate_Hostname->isValid( )  ...\Http.php:445
9   0.2344  1726272 iconv_set_encoding ( )  ...\Hostname.php:649

( ! ) Notice: Undefined offset: 1 in C:\wamp\www\blogger\Zend\Gdata\ClientLogin.php on line 150
Call Stack
#   Time    Memory  Function    Location
1   0.0000  368432  {main}( )   ...\Post.php:0
2   0.1875  1679928 Zend_Gdata_ClientLogin::getHttpClient( )    ...\Post.php:25

( ! ) Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in C:\wamp\www\blogger\Zend\Validate\Hostname.php on line 553
Call Stack
#   Time    Memory  Function    Location
1   0.0000  368432  {main}( )   ...\Post.php:0
2   2.7344  1767560 Zend_Gdata->insertEntry( )  ...\Post.php:45
3   2.7344  1767648 Zend_Gdata->post( ) ...\App.php:980
4   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\App.php:905
5   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
6   2.7656  1772816 Zend_Uri_Http::fromString( )    ...\App.php:649
7   2.7656  1773624 Zend_Uri_Http->__construct( )   ...\Http.php:186
8   2.7656  1774216 Zend_Uri_Http->valid( ) ...\Http.php:154
9   2.7656  1774216 Zend_Uri_Http->validateHost( )  ...\Http.php:277
10  2.7656  1795352 Zend_Validate_Hostname->isValid( )  ...\Http.php:445
11  2.7656  1795784 iconv_set_encoding ( )  ...\Hostname.php:553

( ! ) Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in C:\wamp\www\blogger\Zend\Validate\Hostname.php on line 649
Call Stack
#   Time    Memory  Function    Location
1   0.0000  368432  {main}( )   ...\Post.php:0
2   2.7344  1767560 Zend_Gdata->insertEntry( )  ...\Post.php:45
3   2.7344  1767648 Zend_Gdata->post( ) ...\App.php:980
4   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\App.php:905
5   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
6   2.7656  1772816 Zend_Uri_Http::fromString( )    ...\App.php:649
7   2.7656  1773624 Zend_Uri_Http->__construct( )   ...\Http.php:186
8   2.7656  1774216 Zend_Uri_Http->valid( ) ...\Http.php:154
9   2.7656  1774216 Zend_Uri_Http->validateHost( )  ...\Http.php:277
10  2.7656  1795352 Zend_Validate_Hostname->isValid( )  ...\Http.php:445
11  2.8125  1817056 iconv_set_encoding ( )  ...\Hostname.php:649

( ! ) Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in C:\wamp\www\blogger\Zend\Validate\Hostname.php on line 553
Call Stack
#   Time    Memory  Function    Location
1   0.0000  368432  {main}( )   ...\Post.php:0
2   2.7344  1767560 Zend_Gdata->insertEntry( )  ...\Post.php:45
3   2.7344  1767648 Zend_Gdata->post( ) ...\App.php:980
4   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\App.php:905
5   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
6   2.8125  1774816 Zend_Http_Client->setUri( ) ...\App.php:651
7   2.8125  1774816 Zend_Uri::factory( )    ...\Client.php:305
8   2.8125  1775656 Zend_Uri_Http->__construct( )   ...\Uri.php:143
9   2.8125  1776248 Zend_Uri_Http->valid( ) ...\Http.php:154
10  2.8125  1776248 Zend_Uri_Http->validateHost( )  ...\Http.php:277
11  2.8125  1797384 Zend_Validate_Hostname->isValid( )  ...\Http.php:445
12  2.8125  1797816 iconv_set_encoding ( )  ...\Hostname.php:553

( ! ) Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in C:\wamp\www\blogger\Zend\Validate\Hostname.php on line 649
Call Stack
#   Time    Memory  Function    Location
1   0.0000  368432  {main}( )   ...\Post.php:0
2   2.7344  1767560 Zend_Gdata->insertEntry( )  ...\Post.php:45
3   2.7344  1767648 Zend_Gdata->post( ) ...\App.php:980
4   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\App.php:905
5   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
6   2.8125  1774816 Zend_Http_Client->setUri( ) ...\App.php:651
7   2.8125  1774816 Zend_Uri::factory( )    ...\Client.php:305
8   2.8125  1775656 Zend_Uri_Http->__construct( )   ...\Uri.php:143
9   2.8125  1776248 Zend_Uri_Http->valid( ) ...\Http.php:154
10  2.8125  1776248 Zend_Uri_Http->validateHost( )  ...\Http.php:277
11  2.8125  1797384 Zend_Validate_Hostname->isValid( )  ...\Http.php:445
12  2.9062  1818592 iconv_set_encoding ( )  ...\Hostname.php:649

( ! ) Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in C:\wamp\www\blogger\Zend\Validate\Hostname.php on line 553
Call Stack
#   Time    Memory  Function    Location
1   0.0000  368432  {main}( )   ...\Post.php:0
2   2.7344  1767560 Zend_Gdata->insertEntry( )  ...\Post.php:45
3   2.7344  1767648 Zend_Gdata->post( ) ...\App.php:980
4   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\App.php:905
5   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
6   2.9375  1775888 Zend_Http_Client->request( )    ...\App.php:682
7   3.8594  1780696 Zend_Http_Client->setUri( ) ...\Client.php:1128
8   3.8594  1780696 Zend_Uri::factory( )    ...\Client.php:305
9   3.8594  1781536 Zend_Uri_Http->__construct( )   ...\Uri.php:143
10  3.8594  1782128 Zend_Uri_Http->valid( ) ...\Http.php:154
11  3.8594  1782128 Zend_Uri_Http->validateHost( )  ...\Http.php:277
12  3.8594  1803264 Zend_Validate_Hostname->isValid( )  ...\Http.php:445
13  3.8594  1803696 iconv_set_encoding ( )  ...\Hostname.php:553

( ! ) Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in C:\wamp\www\blogger\Zend\Validate\Hostname.php on line 649
Call Stack
#   Time    Memory  Function    Location
1   0.0000  368432  {main}( )   ...\Post.php:0
2   2.7344  1767560 Zend_Gdata->insertEntry( )  ...\Post.php:45
3   2.7344  1767648 Zend_Gdata->post( ) ...\App.php:980
4   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\App.php:905
5   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
6   2.9375  1775888 Zend_Http_Client->request( )    ...\App.php:682
7   3.8594  1780696 Zend_Http_Client->setUri( ) ...\Client.php:1128
8   3.8594  1780696 Zend_Uri::factory( )    ...\Client.php:305
9   3.8594  1781536 Zend_Uri_Http->__construct( )   ...\Uri.php:143
10  3.8594  1782128 Zend_Uri_Http->valid( ) ...\Http.php:154
11  3.8594  1782128 Zend_Uri_Http->validateHost( )  ...\Http.php:277
12  3.8594  1803264 Zend_Validate_Hostname->isValid( )  ...\Http.php:445
13  3.8750  1824472 iconv_set_encoding ( )  ...\Hostname.php:649

( ! ) Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in C:\wamp\www\blogger\Zend\Validate\Hostname.php on line 553
Call Stack
#   Time    Memory  Function    Location
1   0.0000  368432  {main}( )   ...\Post.php:0
2   2.7344  1767560 Zend_Gdata->insertEntry( )  ...\Post.php:45
3   2.7344  1767648 Zend_Gdata->post( ) ...\App.php:980
4   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\App.php:905
5   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
6   3.8906  1779904 Zend_Gdata->performHttpRequest( )   ...\App.php:700
7   3.8906  1779904 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
8   3.8906  1779872 Zend_Uri_Http::fromString( )    ...\App.php:649
9   3.8906  1780680 Zend_Uri_Http->__construct( )   ...\Http.php:186
10  3.8906  1781272 Zend_Uri_Http->valid( ) ...\Http.php:154
11  3.8906  1781272 Zend_Uri_Http->validateHost( )  ...\Http.php:277
12  3.8906  1802408 Zend_Validate_Hostname->isValid( )  ...\Http.php:445
13  3.8906  1802840 iconv_set_encoding ( )  ...\Hostname.php:553

( ! ) Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in C:\wamp\www\blogger\Zend\Validate\Hostname.php on line 649
Call Stack
#   Time    Memory  Function    Location
1   0.0000  368432  {main}( )   ...\Post.php:0
2   2.7344  1767560 Zend_Gdata->insertEntry( )  ...\Post.php:45
3   2.7344  1767648 Zend_Gdata->post( ) ...\App.php:980
4   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\App.php:905
5   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
6   3.8906  1779904 Zend_Gdata->performHttpRequest( )   ...\App.php:700
7   3.8906  1779904 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
8   3.8906  1779872 Zend_Uri_Http::fromString( )    ...\App.php:649
9   3.8906  1780680 Zend_Uri_Http->__construct( )   ...\Http.php:186
10  3.8906  1781272 Zend_Uri_Http->valid( ) ...\Http.php:154
11  3.8906  1781272 Zend_Uri_Http->validateHost( )  ...\Http.php:277
12  3.8906  1802408 Zend_Validate_Hostname->isValid( )  ...\Http.php:445
13  3.9062  1823616 iconv_set_encoding ( )  ...\Hostname.php:649

( ! ) Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in C:\wamp\www\blogger\Zend\Validate\Hostname.php on line 553
Call Stack
#   Time    Memory  Function    Location
1   0.0000  368432  {main}( )   ...\Post.php:0
2   2.7344  1767560 Zend_Gdata->insertEntry( )  ...\Post.php:45
3   2.7344  1767648 Zend_Gdata->post( ) ...\App.php:980
4   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\App.php:905
5   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
6   3.8906  1779904 Zend_Gdata->performHttpRequest( )   ...\App.php:700
7   3.8906  1779904 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
8   3.9219  1781376 Zend_Http_Client->setUri( ) ...\App.php:651
9   3.9219  1781376 Zend_Uri::factory( )    ...\Client.php:305
10  3.9219  1782216 Zend_Uri_Http->__construct( )   ...\Uri.php:143
11  3.9219  1782808 Zend_Uri_Http->valid( ) ...\Http.php:154
12  3.9219  1782808 Zend_Uri_Http->validateHost( )  ...\Http.php:277
13  3.9219  1803944 Zend_Validate_Hostname->isValid( )  ...\Http.php:445
14  3.9219  1804376 iconv_set_encoding ( )  ...\Hostname.php:553

( ! ) Deprecated: iconv_set_encoding(): Use of iconv.internal_encoding is deprecated in C:\wamp\www\blogger\Zend\Validate\Hostname.php on line 649
Call Stack
#   Time    Memory  Function    Location
1   0.0000  368432  {main}( )   ...\Post.php:0
2   2.7344  1767560 Zend_Gdata->insertEntry( )  ...\Post.php:45
3   2.7344  1767648 Zend_Gdata->post( ) ...\App.php:980
4   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\App.php:905
5   2.7344  1768896 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
6   3.8906  1779904 Zend_Gdata->performHttpRequest( )   ...\App.php:700
7   3.8906  1779904 Zend_Gdata->performHttpRequest( )   ...\Gdata.php:220
8   3.9219  1781376 Zend_Http_Client->setUri( ) ...\App.php:651
9   3.9219  1781376 Zend_Uri::factory( )    ...\Client.php:305
10  3.9219  1782216 Zend_Uri_Http->__construct( )   ...\Uri.php:143
11  3.9219  1782808 Zend_Uri_Http->valid( ) ...\Http.php:154
12  3.9219  1782808 Zend_Uri_Http->validateHost( )  ...\Http.php:277
13  3.9219  1803944 Zend_Validate_Hostname->isValid( )  ...\Http.php:445
14  3.9375  1825152 iconv_set_encoding ( )  ...\Hostname.php:649
ERROR:Unable to Connect to ssl://www.blogger.com:443. Error #0: 

Use wamp php 7.0.23

In my php.ini I have activated extension=php_openssl.dll but the same error jumps.

Thanks for your time I hope some solution

    
asked by BotXtrem Solutions 23.03.2018 в 04:15
source

0 answers