szmnmichalowski / ZF2-NoCaptcha

No CAPTCHA reCAPTCHA module for Zend Framework 2
MIT License
5 stars 5 forks source link

Setting response object status properly using HttpResponse status (#3) #4

Closed catilgan closed 8 years ago

catilgan commented 8 years ago

Solving the issue #3 which occured in my project as well. The solution suggested in issue #3 works perfectly.

I tagged the previous version with 0.0.1. The new version is tagged as 0.02. The unit tests are fixed accordingly to new response status.

catilgan commented 8 years ago

The SSL issues in ticket (#1) can be solved using configuration options as well:


       'options' => [
            'secret_key' => 'xxxxx',
            'site_key'  => 'xxxxxx',
            'sslverifypeer' => false,
            'type' => 'image',
            'theme' => 'light',
            'service_options' => [
                'adapter' => 'Zend\Http\Client\Adapter\Curl', // override the default HttpClient adapter
            ],
        ];
lukassteiner commented 8 years ago

Good solution!

stojko75 commented 8 years ago

SSL issue didn't worked for me. I tried instead:

 /** ReCaptcha Options **/
        $adapter = new \Zend\Http\Client\Adapter\Curl();
        $adapter = $adapter->setCurlOption(CURLOPT_SSL_VERIFYHOST, false);
        $adapter = $adapter->setCurlOption(CURLOPT_SSL_VERIFYPEER, false);

        $options = array(
            'site_key' => 'xxx',
            'secret_key' => 'xxx',
            'sslverifypeer' => false,
            'type' => 'image',
            'theme' => 'light',
        );
        $captcha = new Recaptcha($options);
        $captcha->getService()->setOption('adapter', $adapter);

However, issue #3 worked after fix.