Secure (SSL) Recaptcha

For programming and general questions on Zend Framework
Post Reply
jdrobisz
Posts: 2
Joined: Fri Apr 24, 2009 3:56 pm

Secure (SSL) Recaptcha

Post by jdrobisz » Fri Apr 24, 2009 4:03 pm

I wrote an application which uses Zend_Service_Recaptcha, but over http. I need to force it to use https. Any ideas how? I'm relatively new to Zend framework and any help will be greatly appreciated. Here is the relevant code:

my initializer:

public function initCaptcha()
{
// create recaptcha session and adapter objects then save in registry for future use
$service = new Zend_Service_ReCaptcha(
$this->_config->recaptcha->PrivKey,
$this->_config->recaptcha->PubKey
);
$adapter = new Zend_Captcha_ReCaptcha();
$adapter->setService($service);
Zend_Registry::set('recaptcha', $adapter);
}

and my form:

$element = new Zend_Form_Element_Captcha('recaptcha', array('captcha' => Zend_Registry::get('recaptcha')));

jdrobisz
Posts: 2
Joined: Fri Apr 24, 2009 3:56 pm

Re: Secure (SSL) Recaptcha

Post by jdrobisz » Fri Apr 24, 2009 6:28 pm

Never mind. I can answer my own question. Apparently, I was just missing the following line:

$service->setParams(array('ssl'=>true));

Post Reply