Page 1 of 1

SSL: fatal protocol error

Posted: Thu Nov 10, 2005 7:08 pm
by cyberstryke
I am trying to execute this code which will send some info on over a secure connection. However when executing it I get the following warning message:

https://xx.xxx.xxx.xx:41xxx/cgi-bin/migration-bmn.cgi?cmd=registerplayer&name=plok&cageId=5000002&passwd=22132453&skinId=55000&location=USA&affiliateId=100&email=test%40test.com
Warning: file_get_contents() [function.file-get-contents]: SSL: fatal protocol error in c:\program files\apache....

Hence I dnt get any response from the server.

Anyone with an idea how this could be solved?


Thanks a lot..



Code: Select all

<?



    ignore_user_abort ( 'true' );
    set_time_limit ( 0 );


$connection = pg_connect("dbname=BIMS_DEV user=postgres host=10.1.1.46");
  if (!$connection) {
    print("Connection Failed.");
    exit;
  }
  
  
  $myresult = pg_exec($connection, "Select cageid,screename,affliateid,password,skinid,location from tribeca.dummy"); 

  for ($lt = 0; $lt < pg_numrows($myresult); $lt++) {
    $name = pg_result($myresult, $lt, 1);
    $cageid = pg_result($myresult, $lt, 0);
    $password = pg_result($myresult, $lt, 3);
    $skinid = pg_result($myresult, $lt, 4);
    $location = pg_result($myresult, $lt, 5);
    //$affid = pg_result($myresult, $lt, 2);
    $affid=100;

    $url= "https://xx.xxx.xxx.xx:41xxx/cgi-bin/migration-bmn.cgi?cmd=registerplayer&name=$name&cageId=$cageid&passwd=$password&skinId=$skinid&location=$location&affiliateId=$affid&email=test%40test.com";
    
   
    
    $html = file_get_contents($url);


$tok=strtok($html, "\n");

  while($tok){
  	
  	$toks[] = $tok;
  
    $tok=strtok("\n"); //get next string
   
  }
  
  $errorCode = $toks[0];
  $pieces=explode("=",$errorCode);
  $req_errCode= $pieces[1];
  
  
  
  if ($req_errCode == "0")
  {
    $myresult2 = pg_exec($connection, "Update tribeca.dummy set migrated = true where cageid=$cageid"); 
     
  } 
  
  $myresult3 = pg_exec($connection, "Update tribeca.dummy set errorcode=$req_errCode where cageid=$cageid");
  
   
   
  }

Posted: Thu Nov 10, 2005 9:05 pm
by feyd
your server may not support https protocols, or your server failed to get/validate the certificate sent from the remote server, or similar things..

Posted: Sat Nov 12, 2005 2:50 pm
by cyberstryke
No its working now...I still get the warning but this does not prevent execution of the code. Since this will not be viewed by customers I can leave it like that.

Thanks..

Posted: Sat Nov 12, 2005 6:10 pm
by cyberstryke
I turned down php error handling in my php.ini so the error doesn't show anymore.

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & -E_WARNING


however the SSL connections do not close after subsequent requests. The script still works for its purpose but network guys have been bitching about the fact that we are running very low on bandwidth.

I dnt know if this is related to the fact that the connections are not being closed after each request. May be anyone has got an idea how to close the connection each time.

Thanks..