I am currently using a tcp socket to exchange data between server and client using socket streams in PHP. I want each client to have a unique certificate (which I will generate for them) to access my server, so that only people I know can use it. I searched and found only how to use the server-side certificate, which will allow me to create an SSL socket connection, but I really need to use the client server certificate to identify the client that connects to my server. Is this possible with PHP?
I would suggest that the client connects like this:
$clientCert = './clientCert.pem';
$streamContext = stream_context_create();
stream_context_set_option($streamContext, 'ssl', 'local_cert', $clientCert);
$server = stream_socket_client('ssl://IP', $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext);
But how does the server process (identify, etc.) this client-side certificate?
Hope I understood my question.
Thanks in advance, Raphael
source
share