Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can i use this to sell 3rd level domains? #1

Open
anantsparrow opened this issue Jun 19, 2023 · 5 comments
Open

Can i use this to sell 3rd level domains? #1

anantsparrow opened this issue Jun 19, 2023 · 5 comments

Comments

@anantsparrow
Copy link

Hey there, kindly confirm me if this can help me to sell out my 3rd level domains, just like it.com

@gauzy-gossamer
Copy link
Owner

Yes, that's the purpose of domain registries. They provide a central database for domains and a protocol (EPP) for registrars that they can use to register domains and sell them to end clients.
Although, I need to write an installation guide, right now it's difficult to install it without knowing how the software works.

@anantsparrow
Copy link
Author

Thanks for the reply, I will wait for a installation guide of it. and also a whmcs module for registrars will be appreciated work.

@gauzy-gossamer
Copy link
Owner

I put everything together, so it's possible to run a build with a couple of easy steps. Also added API and CLI tool for administrative tasks.
As for module for registrars, I think there are only a few operations that need to be supported - checking balance, viewing operation statistics and updating registrar info/ registrar acl (ip-address whitelist).

@anantsparrow
Copy link
Author

anantsparrow commented Jun 27, 2023 via email

@gauzy-gossamer
Copy link
Owner

I included a client in python (scripts/epp_client.py), this client in perl should be compatible (https://metacpan.org/release/VADIML/IO-EPP-0.004/source/lib/IO/EPP/RIPN.pm) .

I couldn't find any php clients that would work out of the box, so I tried using php-epp-client, it's possible to use it for most operations if you extend eppHttpConnection and then modify some functions:

class eppTestConnection extends eppHttpConnection {
    protected $defaultnamespace = array('xmlns' => 'http://www.ripn.net/epp/ripn-epp-1.0');

    protected $objuri = array('http://www.ripn.net/epp/ripn-domain-1.0' => 'domain', 'http://www.ripn.net/epp/ripn-contact-1.0' => 'contact', 'http://www.ripn.net/epp/ripn-host-1.0' => 'host');

    protected function initCurl($postMode = true) {
        if ($this->ch === null) {
            $ch = curl_init(); 
            curl_setopt($ch, CURLOPT_URL, $this->getHostname());

            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $this->verify_peer);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->verify_peer);
            curl_setopt($ch, CURLOPT_SSLCERT, getcwd() . "/$this->local_cert_path");
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

            // Logging mode - set curl to verbose
            if ($this->logging) {
                curl_setopt($ch, CURLOPT_VERBOSE, 1);
            }

            if ($postMode) {
                curl_setopt($ch, CURLOPT_POST, 1);
            }

            if ($this->timeout) {
                curl_setopt($ch, CURLOPT_POST, CURLOPT_CONNECTTIMEOUT);
            }

            // Set cookie file
            curl_setopt($ch, CURLOPT_COOKIE, true);
            curl_setopt($ch, CURLOPT_COOKIEFILE, tmpfile());

            $this->ch = $ch;
        }

        return $this->ch;
    }    
    public function write($content) {
        $this->writeLog("Writing: " . strlen($content),'WRITE');

        $ch = $this->initCurl();

        $this->writeLog($content,'WRITE');
        curl_setopt($ch, CURLOPT_POSTFIELDS, $content);
        $response = curl_exec($ch);

        $error = curl_errno($ch);

        if ($error) {
            throw new eppException(sprintf('Error occurred while executing CURL %d: %s', $error, curl_error($ch)),$error,null,curl_error($ch));
        }

        $this->response = $response;
        return true;
    }

}

and then use settings:

interface=eppTestConnection
hostname=https://127.0.0.1:8090
userid=TEST-REG
password=password
logging=true
certificatefile=test-client.pem
verifypeer=false
verifypeername=false
allowselfsigned=true

BTW, the registry uses custom XML namespaces by default. You can switch to default namespaces by setting vals in scripts/build_template.py to :

vals = {
    'epp_ns':'urn:ietf:params:xml:ns:epp-1.0',
    'eppcom_ns':'urn:ietf:params:xml:ns:eppcom-1.0',
    'domain_ns':'urn:ietf:params:xml:ns:domain-1.0',
    'host_ns':'urn:ietf:params:xml:ns:host-1.0',
    'contact_ns':'urn:ietf:params:xml:ns:contact-1.0',
    'registrar_ns':'urn:ietf:params:xml:ns:registrar-1.0',
}

I'll probably switch to default namespaces in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants