Skip to content

A Java EPP client for FRED (Free Registry for ENUM and Domains)

License

Notifications You must be signed in to change notification settings

vagnerj/fred-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FRED

fred-client

A Java EPP client for FRED (Free Registry for ENUM and Domains)

FRED is open-source software for running a domain and ENUM Registry, developed by CZ.NIC, the .CZ and 0.2.4.e164.arpa domain Registry.

Documentation for the whole FRED project is available on-line, visit https://fred.nic.cz/documentation.

NIC.CZ

Client was tested by CZ.NIC, the national registry of .cz domain.

Java CI with Maven Maven Central License Javadocs

Version: 2.47

Changes

2.47
  • Implement new schemas version 2.4.5.
  • Proper naming of few tests.
2.46.1
  • Proper fix of List command in multithreaded environment - thx to vagnerj
2.46
  • Implement new schemas version 2.4.3.
  • Switch mapper tool to MapStruct.
  • Remove poll message type DOMAIN_DELETION - message is in type DOMAIN_EXPIRATION with event type DEL_DATA.
2.44.1
  • Patched version with new version of Maven release plugin and JAXB2 Maven plugin.
2.44 - Corrupted JAR file. Please do not use it.
  • Bumb up version to be compatible with FRED release notes.
  • Implement new schemas version 2.4.2.
  • Add option to trust all servers.
  • Fix security issues from dependabot.
    • Raise log4j version to 2.17.
    • Bump junit from 4.12 to 4.13.2.
  • Fix for List command in multithreaded environment.
  • Add .gitignore file.
2.41
  • Change version to be same as FRED system for compatibility.
  • Change groupId and package names to official one.
0.3.1
  • Add ability to change registrar password via login request.
  • Remove varargs from constructors to keep clean design.
  • Change postal info data for update.
  • Change version number to correct one.
0.3.0
  • Add option turn on validation of responses and requests separately.
  • Add support for multithread systems.
  • Other small improvements and fixes.
0.2.2
  • More mapping tests.
  • Created poll responses pojos for contact, keyset and nsset update.
  • Regenerated class diagram.
0.2.1
  • Generated class diagram.
  • Changed schemas to accept object update poll message.
0.2.1
  • Created remaining methods (without object update poll message yet).
  • Possibility to configure client from outside, via properties file, see Settings section.
  • Possibility to turn off validation of requests and responses (via properties file).
  • Speed improvements, sharing one connection to client.
  • And much more.
0.1.0
  • Removed clientTransactionId attribute from constructors. Can be set using setClientTransactionId method on any request, otherwise will be generated automatically.
  • First version.
  • Possibility to connect to epp.demo.regtest.nic.cz from main method or your application.

Commands

  • Session management commands
    • Login
    • Logout
  • Query commands
    • Check
    • Info
    • Update
    • Polling
  • Transform commands
    • Create
    • Transfer
    • Delete
    • Renew domain
  • Custom commands
    • Credit info
    • Send authInfo
    • Test nsset
    • Listing

Installation

Add as maven dependency to your project.

<dependency>
    <groupId>cz.active24.client.fred</groupId>
    <artifactId>fred-client</artifactId>
    <version>2.47</version>
</dependency>

Settings

Customize fred-client.properties file. You have to provide properties file when initiating client.

###############################################################################
#                     FRED Client Configuration File                          #
###############################################################################
# This is an example of configuration.
#
# Connection settings
# Open instance registrar account
# The client identifier
apiKey.id = REG-FRED_B
# The client’s plain-text password
apiKey.secret = passwd

# Server name
host = epp.demo.regtest.nic.cz
# Server port
port = 700
# Socket timeout (miliseconds)
timeout = 20000

# SSL Properties
# Path to Java keystore with private and public certificate
certificate.file = conf/fred.jks
# Java keystore password
certificate.secret = changeit
# Other settings
keystore.instance = JKS
sslsocket.instance = TLSv1.2
keymanager.instance = SunX509
# Trust all servers
trust.managers.verify = false

# Enable/disable the validation of messages (true enabled, false disabled) - for requests and responses
schema.validation.request = true
schema.validation.response = false

Creating your own java keystore file

Step 1 - Convert the certificate and private key to PKCS 12

openssl pkcs12 -export -in Cert_openinstance.pem -inkey privatekey_openinstance.pem -out private_key.p12 -password pass:changeit

Step 2 - Import the certificate to the keystore

keytool -importkeystore -srcstorepass changeit -deststorepass changeit -destkeystore fred.jks -srckeystore private_key.p12 -srcstoretype PKCS12

Step 3 - Get server certificate

Note: works only for open instance environment - on production instance you'll get certificate from CZ.NIC.

openssl s_client -connect epp.demo.regtest.nic.cz:443 2>/dev/null </dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > server.pem

Step 4 - import downloaded certificate to keystore

keytool -import -alias server -file server.pem -storepass changeit -keystore fred.jks

Usage

  • Add as Maven dependency (or use .jar) to your project. Create instance of FredClient class, properties file as parameter.
  • Feel free to call any command, no need to call login separately, because:
    • Every command checks for connection via hello EPP command,
    • if connection is not established, it creates new ssl connection to server,
    • proceeds login EPP command and try to login,
    • proceeds command you wanted.
  • If you keep your current instance of FredClient class, it reuses created connection.

Enjoy!

Developed with support of

active24.cz

About

A Java EPP client for FRED (Free Registry for ENUM and Domains)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%