Fix SSL connections to USP and IRC

This commit is contained in:
DariusIII
2017-04-25 00:52:14 +02:00
parent c45824ac54
commit 1845bab9ea
3 changed files with 12 additions and 5 deletions
+2
View File
@@ -1,3 +1,5 @@
2017-04-25 DariusIII
* Fix: Fix SSL connections to USP and IRC
2017-04-24 DariusIII
* Chg: Declare return types in AniDB class
* Chg: Chage some if-else loop logic in TMDB class
+5 -4
View File
@@ -498,7 +498,6 @@ class Net_NNTP_Protocol_Client extends PEAR
$port = is_null($port) ? 119 : $port;
break;
case 'sslv3':
case 'ssl':
case 'tls':
$transport = $encryption;
@@ -506,14 +505,16 @@ class Net_NNTP_Protocol_Client extends PEAR
break;
default:
$message = '$encryption parameter must be either tcp, tls, ssl or sslv3.';
$message = '$encryption parameter must be either tcp, tls, ssl.';
trigger_error($message, E_USER_ERROR);
return $this->throwError($message);
}
// Attempt to connect to usenet.
$socket = @stream_socket_client(
$transport . '://' . $host . ':' . $port, $errorNumber, $errorString, $timeout
$socket = stream_socket_client(
$transport . '://' . $host . ':' . $port,
$errorNumber, $errorString, $timeout, STREAM_CLIENT_CONNECT,
stream_context_create(nntmux\utility\Utility::streamSslContextOptions())
);
if ($socket === false) {
+5 -1
View File
@@ -1,6 +1,8 @@
<?php
namespace nntmux;
use nntmux\utility\Utility;
/**
* Basic IRC client for fetching IRCScraper.
*
@@ -662,7 +664,9 @@ class IRCClient
$this->_remote_socket_string,
$error_number,
$error_string,
$this->_remote_connection_timeout
$this->_remote_connection_timeout,
STREAM_CLIENT_CONNECT,
stream_context_create(Utility::streamSslContextOptions(true))
);
if ($socket === false) {