ssl - PHP - Getting more info on failed stream_socket_accept() requests -


i’ve got php communications server running using stream_socket_server() , stream_socket_accept(), complicated thing uses ssl connections , certificates remote side authorized connect server. 1 of things coming in logs failed connections. i’m trying provide more details on these connections security purposes.

i’m getting of error detail on failed connections setting error handler stream_socket_accept() call:

public function on_ssa_error($errno, $errstr)     {     $this->ssa_error .= " error [$errno]: $errstr\n";     }  public function on_select_read()     {     $this->ssa_error = "";     set_error_handler(array($this, "on_ssa_error"));      $rsocket = stream_socket_accept($this->ss, 0);     restore_error_handler();      if ($rsocket !== false)         // finish setting socket connection , start using     else         // report error in $this->ssa_error     } 

…when have failed connection, tend errors this:

error [2]: stream_socket_accept(): ssl operation failed code 1. openssl error messages: error:14094412:ssl routines:ssl3_read_bytes:sslv3 alert bad certificate error [2]: stream_socket_accept(): failed enable crypto error [2]: stream_socket_accept(): accept failed: success 

…which partly useful in identifies cause of bad connection bad certificate, i’d have indicating where bad request came from, ideally ip address or mac address of source.

is there way ip address of failed connection using stream_socket_xxx code? know it’s possible ip address of accepted connection, i’m stumped trying figure out way of getting on failed connection.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -