Zend Soap Client error: Failed to enable crypto - php

Hey guys, I'm using the Zend Soap Client library to consume a webservice, like this:
$wsdl = "path_to_wsdl_file";
$client = new Zend_Soap_Client($wsdl);
$client->nfeRecepcaoLote();
And I'm receiving the following errors:
Warning (2): SoapClient::__doRequest() [soapclient.--dorequest]: Failed to enable crypto [CORE/vendors/plugins/nfe/vendors/Zend/Soap/Client.php, line 987]
Warning (2):SoapClient::__doRequest() [soapclient.--dorequest]: connect() failed: Unspecified error [CORE/vendors/plugins/nfe/vendors/Zend/Soap/Client.php, line 987
Does anyone know what it can possibly be? The host of the webservice is this:
https://homologacao.nfe.ms.gov.br/homologacao/services/NfeRecepcao
and I'm using PHP 5.2.6 and Ubuntu 9.10.
Best regards,
Zé

Looks like is because you are trying to access a SSL service with a self-signed certificate. To allow that you need to authorize it. Look Zend Soap Client documentation on connection adapters.

Related

Asana PHP API Connection Error : 443

I am trying to use the Asana PHP API to build a browser project for personal use, but I am facing problems with connecting to the API.
This is the response i get when trying to fetch the user data from the API.
Fatal error: Uncaught exception 'Httpful\Exception\ConnectionErrorException' with message 'Unable to connect to "https://app.asana.com/api/1.0/users/me": 35 Unknown SSL protocol error in connection to app.asana.com:443 ' in php-asana\vendor\nategood\httpful\src\Httpful\Request.php:208
Here is the code I am using for initializing and fetching the data
require 'php-asana/vendor/autoload.php';
$client = Asana\Client::accessToken(PERSONAL_ACCESS_TOKEN);
$users = $client->users->me();
print_r($users);
The app is set up on my local server. Is it necessary for the client server to have SSL in order to fetch data from the Asana API or am I doing something wrong?
You might be using a deprecated version of TLS to do your requests, please see Asana is now deactivating TLS 1.0
Additionally, the library you are using may not support secure connections

Unable to complete Paypal Instant Payment Notifications due to OpenSSL Error

I am trying to setup Instant Payment Notifications in paypal and am having trouble with POSTing back to tls://www.sandbox.paypal.com during the verification phase.
I am using the code found here: https://developer.paypal.com/docs/classic/ipn/gs_IPN/
Yet, when I try to connect I am receiving these errors:
PHP Warning: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages:
error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure in /htdocs/test.php
fsockopen(): Failed to enable crypto in /htdocs/test.php
I have read the info here and it seems that I am trying to connect using the wrong protocol or I have the wrong cert installed. My OpenSSL is version 1.0.1e.
Unfortunately, I have no idea how to debug this or install the correct cert if necessary
You don't need to install an SSL certificate. It's just that the software stack on your server needs to be updated.
Check this guide on the POODLE Vulnerability for more details.

Can't connect to IMAP with PHP

i'm trying to connect php with an imap server but i'm getting this error:
Warning: imap_open() [function.imap-open]: Couldn't open stream
{mail.XXX.it:143/imap/notls/norsh}INBOX Array ( [0] => SECURITY
PROBLEM: insecure server advertised AUTH=PLAIN [1] => Can not
authenticate to IMAP server: AUTHENTICATE mechanism not supported,
mate ) Cannot connect: 1
When trying to connect mail.XXX.it:143/imap/notls/norsh
And this error:
Warning: imap_open() [function.imap-open]: Couldn't open stream
{mail.XXX.it:143/imap/secure/notls/norsh}INBOX Array ( [0] => Can't do
secure authentication with this server ) Cannot connect: 1
When trying to connect mail.XXX.it:143/imap/secure/notls/norsh
How can i get around this?
(Hosting has no SSL security)
Thanks
Have you tried checking your ssl certs? If the server has a self-signed cert it might cause
php's imap library to throw a configurable error (possibly what you are getting). Furthermore the imap library is installed as a package, sometime separately, you might want to check your configurations for this lib.
Tell me what you think and a curl -v basic auth attempt readout might be helpful,
Cheers

Execute Apple Push Notification Server (PHP) from Android Device using "PHP for Android"

I recently downloaded and installed "PHP for Android." I created a .php file that utilizes an SSL connection with port 2195. I followed a guide for writing a php server that sends push notifications to Apple's APNS, and SUCCESSfully ran it on my Mac. When I put both the .php and the .pem onto my Android phone in the same folder and tried to run it with the same WIFI connection, I get the following error message:
Error:14094410:SSL routines:func(148):reason(1040) in /mnt/sdcard/sl4a/scripts/lot.php on line 19
Warning: stream_socket_client(): Failed to enable crypto in /mnt/sdcard/sl4a/scripts/lot.php on line 19
Warning: stream_socket_client(): unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Unknown error) in /mnt/sdcard/sl4a/scripts/lot.php on line 19
Does anyone have any ideas of how I can fix this?
THANKS!
I had the SSL error on my Windows desktop, with a PHP script that accessed a HTTPS resource.
The solution was to enable the openssl extension. So maybe it's the same kind of problem you have here, something related to opensll on Php for Android.
I'm not sure how to fix it, but Google has it's own push notification framework. There is an example here: http://code.google.com/android/c2dm/
Edit to Answer:
I think that most likely the problem has to do with the certificates needed to make the call over SSL. It is possible that the PHP for Android app does not have permissions to access security certificates you need.

Facebook SDK error: uncaught curlexception: 28: connect() timed out! thrown in php

I just follow same code from Facebook SDK example.
If FB App point to my local desktop, it will get Facebook uid and user basic information (ex email) if APP get permission from OAUTH request.
But when I upload files to server, executing $facebook->api('/me');
Fatal error: Uncaught CurlException: 28: connect() timed out! thrown in
/xxx/src/facebook.php on line 622
I still can't figure out why. It comes from CURL or SSL setting?
My remote server support SSL and CURL is enabled. My local is only CURL but no SSL support.
I think my Facebook SDK is old version, only facebook.php without base_facebook.php.
I try to use new version but can't run any program because crt error.
You get this error because your host cannot access the Facebook API. It might have an old version of Open SSL, can you check the current version on the server?
Try to connect using SSL from your local setup as well as it might be easier to debug on your local machine.
Also, see about that crt (CRC?) error and try to fix that first (don't shave too many Yak's though).

Categories