Download Latest Version tcpconns20221030.tar.gz (276.2 kB)
Email in envelope

Get an email when there's a new version of tcpconns

Home
Name Modified Size InfoDownloads / Week
tcpconns 2022-10-21
README.pdf 2022-10-21 21.5 kB
README.TXT 2022-10-21 5.6 kB
Totals: 3 Items   27.2 kB 0
* ========================================================================
* Copyright (C) 2007-2022
* by J.H.H.C. van der Meijs (tcpconns@jhhcvandermeijs.nl)
* ========================================================================
*/
2022-10-21
Welcome to the updated release candidate of the rewritten tcpconns library.
This update is to get it working with OpenJDK 17 and TLSV1.3.

The goal of the tcpconns library is to save you time, effort, and money
in writing robust multi-threaded tls-capable client server solutions on
java. 

I believe the release candidate is more stable and easier to implement than
the older versions of tcpconns. It is set to use TLS Version 1.3 exclusively
(with OpenJDK 17 LTS or higher). There simply is no reason to use a TLS
Version less than version 1.3 (as far as I currently identify), and an
OpenJDK version of less than version 17 LTS. Source and binaries are
profiled for OpenJDK17.

NOTE: the X509 credentials have been updated and now given a validity period
of 100 years. So, for testing purposes you should be good to go.

NOTE: When you use ORACLE's JDK or JRE/JVM (instead of OpenJDK), 
please also install the Java Cryptography Extension (JCE) Unlimited 
Strength Jurisdiction Policy Files for the TLS to work in its current 
configuration (if this still is applicable; I don't use Oracle's JDK any
more, only OpenJDK, so I don't know if it is still applicable).
N.B.: You might have to register for an oracle account to download them.

NOTE: This version is release candidate quality. Please test and
report any bugs or possible bugs you come across. 

NOTE: This version is NOT compatible with the older tcpconns library
versions. 

NOTE: The license has changed: you can now use tcpconns under any OSI license
you wish. 

NOTE: The rest of the older library is in the process of being converted and
updated. I do not know how long it will take to do this. <- I don't have any
time!! If you'd like to sponser this project, please let me know.

NOTE: Documentation will be updated prior to release.

public class TCPClient: PROVIDES A SIMPLE INTERFACE FOR TCP AND TLS
COMMUNICATIONS. SEE THE EXAMPLE TESTCLIENT PROJECT FOR HOW TO USE
#####################################################################

| connect(String ip, int port) |     Use this method to connect the client to
a server. Returns true if there were no errors.
| isConnected() |     This method determines whether the TCPClient object is
connected to a server.
| disconnect() |     Terminates the connection. Returns true (never fails).


| in() |     Once connected or made (in)secure, use this DataInputStream to
read from the connection.
| out() |     Once connected or made (in)secure, use this DataOutputStream
to write to the connection.
| rawIn() |     Use this method to get a handle on the raw socket InputStream.
| rawOut() |     Use this method to get a handle on the raw socket output stream.


| setCredentials(String certificateChainPKCS12FileName, char[] passphrase) |
Use this method to set the client X509 certificate and key if required by
the server.
| addTrustedCA(String trustedCACERFileName) |     This method adds the X509
certificate of a certificate authority you trust. If none were added the
server certificate is not checked for validity.
| makeSecure() |     Use this method to make the connection secure; if
credentials were set, they will be used; if trustedCAs were added, they will
be used in an attempt to verify the peer certificate; NOTE: if trustedCAs were
added and the peer certificate was not signed by one of them will reset (end)
the connection. Returns true if there were no errors.
| isSecure() |     Use this method to determine if the connection is secure.
| makeInSecure() |     Use this method to make the channel insecure again
after makeSecure has been called.


| clearCredentials() |     This method clears any X509 credentials that
have been set.
| clearTrustedCAs() |     This method clears any added trusted certificate
authority X509 certificates.


| getSecureProtocol() |     Use this method to obtain the protocol
used (eg TLSv1.3); this method returns NOT_CONNECTED if not connected and
INSECURE when insecure.
| getSecureCipherSuite() |     Use this method to obtain the cipher suite
used; this method returns NOT_CONNECTED if not connected and INSECURE when
insecure.
| getPeerCertificateChain() |     Use this method, prn, if you want access
to the peer certificate chain. Returns an X509Certificate array containing
the peer certificate chain.


public abstract class TCPServer: "MYSERVER EXTENDS TCPSERVER" AND OVERRIDE
THE PROCESSREQUEST METHOD. SEE THE EXAMPLE TESTSERVER PROJECT FOR HOW TO USE
#####################################################################
    
Methods similar to the TCPClient
setCredentials(String certificateChainPKCS12FileName, char[] passphrase)
clearCredentials() 
addTrustedCA(String trustedCACERFileName)
clearTrustedCAs() {
         
    
| serve(String ip, int port) |    Call this method to make the server active
| isActive() |    Use this method to determine if the server IS active
| shutdown() |    Use this method to shutdown the server  


@Override
public void processRequest() throws IOException {} <==== override this method


The following may be used by you or not:
| getSharedObjectLock() |   Use this method to obtain a lock that you can and
may use to set and get the shared object or to get and set any of the data it
contains.
| getSharedObject() |   Use this method to obtain the shared object.
| setSharedObject(Object sharedObject) |    Use this method to set the shared
object.
Source: README.TXT, updated 2022-10-21