error connecting exim with ssl and fsockopen

Mangas23

Verified User
Joined
Aug 31, 2006
Messages
104
RESOLVED - error connecting exim with ssl and fsockopen

Hello,
I try to send mail via fsockopen (roundcube) with ssl activate, but message never send. when i try this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>

<?php
$fp = fsockopen("ssl://localhost", 465, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
}

else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: localhost\r\n";
$out .= "Connection: Close\r\n\r\n";

fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>


</body>
</html>

I have this respond:
Warning: fsockopen() [function.fsockopen]: SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol in /home/stbarthfwi/domains/stbarthfwi.net/public_html/langues/fr/test.php on line 11

Warning: fsockopen() [function.fsockopen]: Failed to enable crypto in /home/stbarthfwi/domains/stbarthfwi.net/public_html/langues/fr/test.php on line 11

Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://localhost:465 (Unknown error) in /home/stbarthfwi/domains/stbarthfwi.net/public_html/langues/fr/test.php on line 11
(0)

Sending mail via outlook or other and ssl activate on port 465 it's work fine, or if i use stunnel, to use port 587 with ssl (smtps),and configure roundcube conf to use ssl on port 587, it's work to.

Someone can help me ?

!! resolved !!
I need add this in exim.conf: tls_on_connect_ports = 465
 
Last edited:
Back
Top