Permalink
Browse files

added missing branches

added missing branches
  • Loading branch information...
1 parent 1516f9a commit edec0bca314ef0e32ab0a4c65cc878b50a6e0ca8 @pocketcrocodile committed Feb 25, 2012
Showing with 6 additions and 4 deletions.
  1. +2 −1 lib/Cake/Network/Http/HttpResponse.php
  2. +4 −3 lib/Cake/Network/Http/HttpSocket.php
@@ -428,8 +428,9 @@ public function offsetGet($offset) {
public function setContext($context){
if (get_resource_type($context) === "OpenSSL X.509" && function_exists(openssl_x509_export)){
- if (!isset($context))
+ if (!isset($context)){
return false;
+ }
openssl_x509_export($context, &$certstring);
$certstring = str_replace('-----BEGIN CERTIFICATE-----', '', $certstring);
$certstring = str_replace('-----END CERTIFICATE-----', '', $certstring);
@@ -384,9 +384,9 @@ public function request($request = array()) {
$responseClass = $this->responseClass;
$this->response = new $responseClass($response);
- if (!empty($context) && isset($context['ssl']['peer_certificate']))
+ if (!empty($context) && isset($context['ssl']['peer_certificate'])){
$this->response->setContext($context['ssl']['peer_certificate']);
-
+ }
if (!empty($this->response->cookies)) {
if (!isset($this->config['request']['cookies'][$Host])) {
$this->config['request']['cookies'][$Host] = array();
@@ -759,8 +759,9 @@ private function _configContext($context = null){
public function checkFingerprint($fingerprint){
- if (!isset($this->request['context']['ssl']['peer_certificate']))
+ if (!isset($this->request['context']['ssl']['peer_certificate'])){
return false;
+ }
openssl_x509_export($this->request['context']['ssl']['peer_certificate'], &$certstring);
$certstring = str_replace('-----BEGIN CERTIFICATE-----', '', $certstring);
$certstring = str_replace('-----END CERTIFICATE-----', '', $certstring);

0 comments on commit edec0bc

Please sign in to comment.