| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2014-12-09 15:08 UTC] scott at arciszewski dot me
 Description: ------------ Curl 7.39.00 supports a --pinnedpubkey flag which allows you to pin the public key used by the connection, and abort otherwise. http://curl.haxx.se/docs/manpage.html Test script: --------------- <?php // Desired usage: $ch = curl_init("https://example.com"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_PINNED_PUBKEY, $pem_public_key); $result = curl_exec($ch); if ($result !== false) { var_dump($result); } PatchesPull Requests
Pull requests: 
 HistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 13:00:02 2025 UTC | 
So if it is just the constant definition, which was missing, am I right that I could manually define the constant CURLOPT_PINNEDPUBLICKEY in PHP > 7.0.7 to use it? <?php defined('CURLOPT_PINNEDPUBLICKEY') || define('CURLOPT_PINNEDPUBLICKEY', 1234); $ch = curl_init("https://example.com"); curl_setopt($ch, CURLOPT_PINNEDPUBLICKEY, "sha256//YhKJKSzoTt2b5FP18fvpHo7fJYqQCjAa3HWY3tvRMwE=;sha256//t62CeU2tQiqkexU74Gxa2eg7fRbEgoChTociMee9wno="); // and so on... If so can anyone please tell me what value "CURLOPT_PINNEDPUBLICKEY" actually has? In my example above I used 1234 just as a placeholder. Also will older curl version ignore the value or do I have to check whether the installed curl version supports this constant?