Skip to content
Snippets Groups Projects
Commit c3dc2f5d authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Fixed bug with SSL setting & include path

parent 1b8c30c0
No related branches found
No related tags found
No related merge requests found
......@@ -36,8 +36,6 @@
# http://allworldit.com
## VERSION: 0.1.0 ##
# Configuration array
function cozaepp_getConfigArray() {
......@@ -788,28 +786,34 @@ function cozaepp_DeleteNameserver($params) {
function _cozaepp_Client() {
# Setup include dir
$include_path = ROOTDIR . '/modules/registrars/cozaepp';
set_include_path(get_include_path() . PATH_SEPARATOR . $include_path);
include_once 'Net/EPP/Client.php';
include_once 'Net/EPP/Protocol.php';
set_include_path($include_path . PATH_SEPARATOR . get_include_path());
require_once 'Net/EPP/Client.php';
require_once 'Net/EPP/Protocol.php';
# Grab module parameters
$params = getregistrarconfigoptions('cozaepp');
# Create EPP client
$client = new Net_EPP_Client();
# Set certificate if we have one
# Are we using ssl?
$use_ssl = false;
if (isset($params['SSL']) && $params['SSL'] == "on" && isset($params['Certificate']) && file_exists($params['Certificate'])) {
if (isset($params['SSL']) && $params['SSL'] == 'on') {
$use_ssl = true;
}
# Set certificate if we have one
if ($use_ssl && isset($params['Certificate']) && file_exists($params['Certificate'])) {
# Create SSL context
$context = stream_context_create();
stream_context_set_option($context, 'ssl', 'local_cert', $params['Certificate']);
$use_ssl = true;
}
# Create EPP client
$client = new Net_EPP_Client();
# Connect
$client->connect($params['Server'], $params['Port'], 50, $use_ssl, $context);
$res = $client->connect($params['Server'], $params['Port'], 30, $use_ssl, $context);
# Check for error
if (PEAR::isError($res)) {
return $res;
}
# Perform login
$result = $client->request('
......@@ -835,4 +839,6 @@ function _cozaepp_Client() {
return $client;
}
?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment