note 125258 added to function.openssl-x509-checkpurpose

From: Date: Tue, 11 Aug 2020 07:15:24 +0000
Subject: note 125258 added to function.openssl-x509-checkpurpose
Groups: php.notes 
Request: Send a blank email to php-notes+get-214943@lists.php.net to get a copy of this message
in one word :if you set $purpose=0, you can use this function to verify certificate chain. ==================================================================== I want to verify a certificate chain. just like this: userCert.pem => middleCert.pem => rootCert.pem I figured that none of these openssl functions provide this function directly. And some friends have same need as me, "mikey at badpenguins dot com" even write his own code to verify certificate chain(you can see notes below openssl_verify). and I notice a note which has '-3' likes below openssl_verify, it says "validating an X509 certificate chain in php seems to be possible with openssl_x509_checkpurpose()", and I read the source code about this function, the given constant var about $purpose (like X509_PURPOSE_SSL_CLIENT ) is 1-7, and if you set $purpose among 1-7, you cannot verify the cert chain. Set $purpose=0 can get the truly result about verify a cert chain. and I give that '-3' note a thumb-up, now it has -2 , lol. ---- Server IP: 45.112.84.4 Probable Submitter: 103.51.166.36 (proxied: 203.205.141.50) ---- Manual Page -- http://php.net/manual/en/function.openssl-x509-checkpurpose.php Edit -- https://master.php.net/note/edit/125258 Del: integrated -- https://master.php.net/note/delete/125258/integrated Del: useless -- https://master.php.net/note/delete/125258/useless Del: bad code -- https://master.php.net/note/delete/125258/bad+code Del: spam -- https://master.php.net/note/delete/125258/spam Del: non-english -- https://master.php.net/note/delete/125258/non-english Del: in docs -- https://master.php.net/note/delete/125258/in+docs Del: other reasons-- https://master.php.net/note/delete/125258 Reject -- https://master.php.net/note/reject/125258 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#214943) next »