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.
Client was tested by CZ.NIC, the national registry of .cz domain.
Version: 2.47
Changes
- Implement new schemas version 2.4.5.
- Proper naming of few tests.
- Proper fix of List command in multithreaded environment - thx to vagnerj
- 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.
- Patched version with new version of Maven release plugin and JAXB2 Maven plugin.
- 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.
- Change version to be same as FRED system for compatibility.
- Change groupId and package names to official one.
- 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.
- Add option turn on validation of responses and requests separately.
- Add support for multithread systems.
- Other small improvements and fixes.
- More mapping tests.
- Created poll responses pojos for contact, keyset and nsset update.
- Regenerated class diagram.
- Generated class diagram.
- Changed schemas to accept object update poll message.
- 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.
- 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
- Please read https://www.nic.cz/page/744/registracni-system/.
- At first you need your own private certificate and key and public certificate of the server. For open instance you can use this private key https://www.nic.cz/files/nic/doc/pristupy_openinstance.zip.
- Credits to https://www.wowza.com/docs/how-to-import-an-existing-ssl-certificate-and-private-key#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
keytool -importkeystore -srcstorepass changeit -deststorepass changeit -destkeystore fred.jks -srckeystore private_key.p12 -srcstoretype PKCS12
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
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