I want to create an application which passes a text message to a server trough an ssl port
I couldn't use curl and I need to encrypt using public key.
I expect anybody to help me.
Thanking You
Well we can't help if you don't post the code and tell us *exactly* what the error message is or what the undesired/desired behaviour is. You just say you want to encrypt some text but where is this text? in a web form? what? are you using HTTP or Opening TCP sockets? More info please.
The text I want to encrypt will be available in a variable somehow.
It actually returns an error saying the browser speaks plain html it couldn't understood by the server
But when I made my code to as shown below I got the following result
**************
<?php
$fp=fopen("/usr/local/apache/conf/ssl.crt/server.crt","r");
$pub_key=fread($fp,8192);
fclose($fp);
openssl_get_publickey($pub_key);
//print_r($pub_key);
$strMessage='This';
$strAddress="localhost";
$intPort="443";
$strScriptName = "index.php";
$fphSocket = fsockopen ("ssl://".$strAddress, $intPort, $strErrorNumber, $strErrorString,30);
//stream_set_blocking ( $fphSocket, 0 );
if (!$fphSocket) {
echo"Outer". "$strErrorString ($strErrorNumber)<br />\n";
}
else{
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.