PemBer - Professional Paid Membership Plugin [Deleted]

It appears to be broken now. TLS errors with PayPal and members are no longer able to cancel their memberships.
Holy crap you are right. I just logged into my admincp and got this:

There was an error verifying TLS support for your server. The exception message is Unable to Connect to ssl://tlstest.paypal.com:443. Error #0: php_network_getaddresses: getaddrinfo failed: Name or service not known.

Is there a solution or are we screwed?
 
Is there a solution or are we screwed?
Based on the thread that @sbj posted and the core fix posted by @Chris D in that thread (thanks!)...
  1. Edit: /(XF install dir)/library/PemBer/Model/Paypal.php
  2. Find public static function runTlsTest
  3. Assuming your installs of both PHP and cURL support TLS 1.2, replace everything in the function with return 4;
And it sounds like it's just a check, so this should at least remove the annoying warning until you upgrade to XF 2.1 and ask @AddonFlare if they'll help port you over to their Paid Registrations. ;)

I'll post an update if anything breaks...
 
  • Like
Reactions: sbj
@Hardcore

Are you saying to remove the following from /(XF install dir)/library/PemBer/Model/Paypal.php and replace with "return 4;"?


Code:
public static function runTlsTest(&$error = null)
    {
        try
        {
            $url = 'https://tlstest.paypal.com/';
            $result = false;

            $client = self::getHttpClient($url);
            $body = $client->request('GET')->getBody();

            $adapterOptions = array(
                    'adapter' => 'Zend_Http_Client_Adapter_Curl',
                    'curloptions' => array(CURLOPT_SSLVERSION => 6)
            );

            $curl_client = new Zend_Http_Client($url, $adapterOptions);
            $curlBody = $curl_client->request('GET')->getBody();

            if($body != 'PayPal_Connection_OK' && $curlBody != 'PayPal_Connection_OK')
            {
                // Bad Bad server, Neither PHP nor cURL support TLS1.2
                $result = 1;
            }
            elseif($body != 'PayPal_Connection_OK')
            {
                // Server's PHP does not support TLS1.2
                $result = 2;
            }
            elseif ($curlBody != 'PayPal_Connection_OK')
            {
                // cURL does not support TLS1.2
                $result = 3;
            }
            else
            {
                // Both PHP and cURL support TLS1.2
                $result = 4;
            }
        }
        catch (Exception $e)
        {
            $error = $e->getMessage();
            return false;
        }

        return $result;
    }
 
Last edited:
Are you saying to remove the following from /(XF install dir)/library/PemBer/Model/Paypal.php and replace with "return 4;"?
More like this (I left two lines of code to explain why):
Code:
public static function runTlsTest(&$error = null)
    {
        // Both PHP and cURL support TLS1.2
        $result = 4;
        return $result;
    }
Again, this is based on the update that @Chris D posted in the other thread and it assumes that PHP and cURL on your server supports TLS 1.2.
 
Thanks! Yes, I also used the update from Chris and PHP and cURL on my server supports TLS 1.2.

Haven't tested if recurring subscribers can cancel yet, but no error in admin anymore.
 
Top Bottom